Search in sources :

Example 1 with SetTypeCommand

use of org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand in project webtools.sourceediting by eclipse.

the class SetTypeAction method run.

public void run() {
    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
    if (selection instanceof XSDBaseAdapter) {
        Object target = ((XSDBaseAdapter) selection).getTarget();
        if (target instanceof XSDConcreteComponent) {
            command = new SetTypeCommand(Messages._UI_ACTION_SET_TYPE, getId(), (XSDConcreteComponent) target);
            command.setAdapter((XSDBaseAdapter) selection);
            getCommandStack().execute(command);
        }
    }
}
Also used : SetTypeCommand(org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand) XSDConcreteComponent(org.eclipse.xsd.XSDConcreteComponent) XSDBaseAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 XSDBaseAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter)1 SetTypeCommand (org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand)1 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)1