use of org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDModelGroupDefinitionCommand in project webtools.sourceediting by eclipse.
the class AddXSDModelGroupDefinitionAction method run.
public void run() {
Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
XSDConcreteComponent xsdConcreteComponent = null;
if (selection instanceof XSDBaseAdapter) {
xsdConcreteComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
}
if (xsdConcreteComponent != null) {
AddXSDModelGroupDefinitionCommand command = new AddXSDModelGroupDefinitionCommand(getText(), xsdConcreteComponent, isReference);
getCommandStack().execute(command);
addedComponent = command.getAddedComponent();
Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
selectAddedComponent(adapter);
}
}
Aggregations