use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard in project webtools.sourceediting by eclipse.
the class RenameHandler method run.
public void run(ISelection selection, XSDSchema schema, XSDNamedComponent selectedComponent) {
if (selectedComponent.getName() == null) {
selectedComponent.setName(new String());
}
if (selectedComponent.getSchema() == null) {
if (schema != null) {
schema.updateElement(true);
}
}
boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
if (!rc) {
return;
}
RefactoringComponent component = new XMLRefactoringComponent(selectedComponent, (IDOMElement) selectedComponent.getElement(), selectedComponent.getName(), selectedComponent.getTargetNamespace());
RenameComponentProcessor processor = new RenameComponentProcessor(component, selectedComponent.getName());
RenameRefactoring refactoring = new RenameRefactoring(processor);
try {
RefactoringWizard wizard = new RenameRefactoringWizard(refactoring, 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 canceled
}
}
use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard 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
}
}
use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard in project webtools.sourceediting by eclipse.
the class RenameComponentAction method run.
public void run(ISelection selection) {
if (selectedComponent.getName() == null) {
selectedComponent.setName(new String());
}
if (selectedComponent.getSchema() == null) {
if (getSchema() != null) {
getSchema().updateElement(true);
}
}
boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
if (!rc) {
return;
}
RefactoringComponent component = new XMLRefactoringComponent(selectedComponent, (IDOMElement) selectedComponent.getElement(), selectedComponent.getName(), selectedComponent.getTargetNamespace());
RenameComponentProcessor processor = new RenameComponentProcessor(component, selectedComponent.getName());
RenameRefactoring refactoring = new RenameRefactoring(processor);
try {
RefactoringWizard wizard = new RenameRefactoringWizard(refactoring, RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null);
RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
// TODO (cs) I'm not sure why we need to do this. See bug 145700
// triggerBuild();
} catch (InterruptedException e) {
// do nothing. User action got cancelled
}
}
use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard in project webtools.sourceediting by eclipse.
the class MakeAnonymousTypeGlobalAction method run1.
public void run1() {
if (fSelectedComponent == null) {
return;
}
if (fSelectedComponent.getSchema() == null) {
getSchema().updateElement(true);
}
MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
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());
// triggerBuild();
} catch (InterruptedException e) {
// do nothing. User action got cancelled
}
}
use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard in project webtools.sourceediting by eclipse.
the class RenameTargetNamespaceAction method run.
public void run(ISelection selection) {
RenameTargetNamespaceProcessor processor = new RenameTargetNamespaceProcessor(getSchema(), getSchema().getTargetNamespace());
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());
triggerBuild();
} catch (InterruptedException e) {
// do nothing. User action got cancelled
}
}
Aggregations