Search in sources :

Example 1 with RenameResourceProcessor

use of org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor in project webtools.sourceediting by eclipse.

the class RenameResourceAction method run.

public void run(IStructuredSelection selection) {
    IResource resource = getResource(selection);
    RenameResourceProcessor processor = new RenameResourceProcessor(resource);
    if (!processor.isApplicable())
        return;
    RenameRefactoring refactoring = new RenameRefactoring(processor);
    try {
        RefactoringWizard wizard = new RenameRefactoringWizard(refactoring, // TODO: provide correct strings
        RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null);
        RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
        op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
    } catch (InterruptedException e) {
    // do nothing. User action got cancelled
    }
}
Also used : RenameResourceProcessor(org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor) RefactoringWizardOpenOperation(org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation) RenameRefactoringWizard(org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard) RenameRefactoringWizard(org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard) RefactoringWizard(org.eclipse.ltk.ui.refactoring.RefactoringWizard) RenameRefactoring(org.eclipse.ltk.core.refactoring.participants.RenameRefactoring) IResource(org.eclipse.core.resources.IResource)

Example 2 with RenameResourceProcessor

use of org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor in project webtools.sourceediting by eclipse.

the class RenameResourceAction method selectionChanged.

public void selectionChanged(IStructuredSelection selection) {
    IResource element = getResource(selection);
    if (element == null) {
        setEnabled(false);
    } else {
        RenameResourceProcessor processor = new RenameResourceProcessor(element);
        setEnabled(processor.isApplicable());
    }
}
Also used : RenameResourceProcessor(org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor) IResource(org.eclipse.core.resources.IResource)

Aggregations

IResource (org.eclipse.core.resources.IResource)2 RenameResourceProcessor (org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor)2 RenameRefactoring (org.eclipse.ltk.core.refactoring.participants.RenameRefactoring)1 RefactoringWizard (org.eclipse.ltk.ui.refactoring.RefactoringWizard)1 RefactoringWizardOpenOperation (org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation)1 RenameRefactoringWizard (org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard)1