Search in sources :

Example 1 with MakeAnonymousTypeGlobalCommand

use of org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand in project webtools.sourceediting by eclipse.

the class MakeAnonymousTypeGobalHandler method run.

public void run(ISelection selection, XSDSchema schema, XSDTypeDefinition selectedComponent) {
    if (selectedComponent == null) {
        return;
    }
    if (selectedComponent.getSchema() == null) {
        schema.updateElement(true);
    }
    DocumentImpl doc = (DocumentImpl) selectedComponent.getElement().getOwnerDocument();
    doc.getModel().beginRecording(this, RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
    MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(selectedComponent, getNewDefaultName());
    command.run();
    doc.getModel().endRecording(this);
}
Also used : MakeAnonymousTypeGlobalCommand(org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand) DocumentImpl(org.eclipse.wst.xml.core.internal.document.DocumentImpl)

Example 2 with MakeAnonymousTypeGlobalCommand

use of org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand in project webtools.sourceediting by eclipse.

the class MakeAnonymousTypeGlobalAction method run.

public void run() {
    if (fSelectedComponent == null) {
        return;
    }
    if (fSelectedComponent.getSchema() == null) {
        getSchema().updateElement(true);
    }
    DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
    doc.getModel().beginRecording(this, RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
    MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(fSelectedComponent, getNewDefaultName());
    command.run();
    doc.getModel().endRecording(this);
}
Also used : MakeAnonymousTypeGlobalCommand(org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand) DocumentImpl(org.eclipse.wst.xml.core.internal.document.DocumentImpl)

Aggregations

DocumentImpl (org.eclipse.wst.xml.core.internal.document.DocumentImpl)2 MakeAnonymousTypeGlobalCommand (org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand)2