Search in sources :

Example 1 with DeleteXSDConcreteComponentAction

use of org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction in project webtools.sourceediting by eclipse.

the class InternalXSDMultiPageEditor method createActions.

protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();
    // add an isReadOnly method to the editorPart instead
    if (!isReadOnly()) {
        BaseSelectionAction action = new AddFieldAction(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new DeleteAction(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new DesignSelectAll(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new AddXSDRedefinedComplexTypeAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_COMPLEX_TYPE));
        registry.registerAction(action);
        action = new AddXSDRedefinedSimpleTypeAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_SIMPLE_TYPE));
        registry.registerAction(action);
        action = new AddXSDRedefinedAttributeGroupAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_ATTRIBUTE_GROUP));
        registry.registerAction(action);
        action = new AddXSDRedefinedModelGroupAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_MODEL_GROUP));
        registry.registerAction(action);
        action = new SetBaseTypeAction(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new AddXSDElementAction(this, AddXSDElementAction.ID, Messages._UI_ACTION_ADD_ELEMENT, false);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
        registry.registerAction(action);
        action = new AddXSDElementAction(this, AddXSDElementAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
        registry.registerAction(action);
        action = new AddXSDElementAction(this, AddXSDElementAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
        registry.registerAction(action);
        action = new AddXSDElementAction(this, AddXSDElementAction.REF_ID, Messages._UI_ACTION_ADD_ELEMENT_REF, true);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElementRef.gif"));
        registry.registerAction(action);
        action = new AddXSDModelGroupAction(this, XSDCompositor.SEQUENCE_LITERAL, AddXSDModelGroupAction.SEQUENCE_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSequence.gif"));
        registry.registerAction(action);
        action = new AddXSDModelGroupAction(this, XSDCompositor.CHOICE_LITERAL, AddXSDModelGroupAction.CHOICE_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDChoice.gif"));
        registry.registerAction(action);
        action = new AddXSDModelGroupAction(this, XSDCompositor.ALL_LITERAL, AddXSDModelGroupAction.ALL_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAll.gif"));
        registry.registerAction(action);
        action = new AddXSDModelGroupDefinitionAction(this, false);
        action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDGroup.gif"));
        registry.registerAction(action);
        action = new AddXSDModelGroupDefinitionAction(this, true);
        action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/obj16/XSDGroupRef.gif"));
        registry.registerAction(action);
        action = new AddXSDComplexTypeDefinitionAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDComplexType.gif"));
        registry.registerAction(action);
        action = new AddXSDSimpleTypeDefinitionAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleType.gif"));
        registry.registerAction(action);
        action = new AddXSDAttributeDeclarationAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
        registry.registerAction(action);
        action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
        registry.registerAction(action);
        action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
        registry.registerAction(action);
        action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.REF_ID, Messages._UI_ACTION_ADD_ATTRIBUTE_REF, true);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeRef.gif"));
        registry.registerAction(action);
        action = new OpenInNewEditor(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new ShowPropertiesViewAction(this);
        registry.registerAction(action);
        action = new AddXSDAttributeGroupDefinitionAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeGroup.gif"));
        registry.registerAction(action);
        action = new AddXSDAttributeGroupDefinitionAction(this, AddXSDAttributeGroupDefinitionAction.REF_ID);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeGroupRef.gif"));
        registry.registerAction(action);
        action = new DeleteXSDConcreteComponentAction(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new AddXSDAnyElementAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAny.gif"));
        registry.registerAction(action);
        action = new AddXSDAnyAttributeAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAnyAttribute.gif"));
        registry.registerAction(action);
        action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.INCLUDE_ID, Messages._UI_ACTION_ADD_INCLUDE);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDInclude.gif"));
        registry.registerAction(action);
        action = new AddXSDEnumerationFacetAction(this);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
        registry.registerAction(action);
        action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
        registry.registerAction(action);
        action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
        registry.registerAction(action);
        action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.IMPORT_ID, Messages._UI_ACTION_ADD_IMPORT);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDImport.gif"));
        registry.registerAction(action);
        action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.REDEFINE_ID, Messages._UI_ACTION_ADD_REDEFINE);
        action.setSelectionProvider(getSelectionManager());
        action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDRedefine.gif"));
        registry.registerAction(action);
        SetTypeAction setNewComplexTypeAction = new SetTypeAction(Messages._UI_ACTION_NEW, SetTypeAction.SET_NEW_TYPE_ID, this);
        setNewComplexTypeAction.setSelectionProvider(getSelectionManager());
        registry.registerAction(setNewComplexTypeAction);
        SetTypeAction setExistingTypeAction = new SetTypeAction(Messages._UI_ACTION_BROWSE, SetTypeAction.SELECT_EXISTING_TYPE_ID, this);
        setExistingTypeAction.setSelectionProvider(getSelectionManager());
        registry.registerAction(setExistingTypeAction);
        addMultiplicityMenu(registry);
        PrintAction printAction = new PrintAction(this);
        registry.registerAction(printAction);
        BaseDirectEditAction directEditAction = new BaseDirectEditAction(this);
        directEditAction.setSelectionProvider(getSelectionManager());
        registry.registerAction(directEditAction);
    } else {
        BaseSelectionAction action = new OpenInNewEditor(this);
        action.setSelectionProvider(getSelectionManager());
        registry.registerAction(action);
        action = new ShowPropertiesViewAction(this);
        registry.registerAction(action);
        PrintAction printAction = new PrintAction(this);
        registry.registerAction(printAction);
    }
}
Also used : AddFieldAction(org.eclipse.wst.xsd.ui.internal.adt.actions.AddFieldAction) AddXSDRedefinedAttributeGroupAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction) AddXSDRedefinedModelGroupAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction) DeleteXSDConcreteComponentAction(org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction) AddXSDComplexTypeDefinitionAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction) PrintAction(org.eclipse.gef.ui.actions.PrintAction) ShowPropertiesViewAction(org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction) ActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry) BaseSelectionAction(org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction) OpenInNewEditor(org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor) AddXSDAnyAttributeAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction) AddXSDAnyElementAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction) AddXSDElementAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction) BaseDirectEditAction(org.eclipse.wst.xsd.ui.internal.adt.actions.BaseDirectEditAction) AddXSDModelGroupAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction) AddXSDAttributeDeclarationAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction) SetTypeAction(org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction) SetBaseTypeAction(org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction) AddXSDRedefinedComplexTypeAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction) AddXSDSchemaDirectiveAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction) AddXSDEnumerationFacetAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction) AddXSDSimpleTypeDefinitionAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction) AddXSDAttributeGroupDefinitionAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction) AddXSDRedefinedSimpleTypeAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedSimpleTypeAction) AddXSDModelGroupDefinitionAction(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction) DeleteAction(org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction) DesignSelectAll(org.eclipse.wst.xsd.ui.internal.adt.actions.DesignSelectAll)

Aggregations

ActionRegistry (org.eclipse.gef.ui.actions.ActionRegistry)1 PrintAction (org.eclipse.gef.ui.actions.PrintAction)1 AddFieldAction (org.eclipse.wst.xsd.ui.internal.adt.actions.AddFieldAction)1 BaseDirectEditAction (org.eclipse.wst.xsd.ui.internal.adt.actions.BaseDirectEditAction)1 BaseSelectionAction (org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction)1 DeleteAction (org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction)1 DesignSelectAll (org.eclipse.wst.xsd.ui.internal.adt.actions.DesignSelectAll)1 ShowPropertiesViewAction (org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction)1 AddXSDAnyAttributeAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction)1 AddXSDAnyElementAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction)1 AddXSDAttributeDeclarationAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction)1 AddXSDAttributeGroupDefinitionAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction)1 AddXSDComplexTypeDefinitionAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction)1 AddXSDElementAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction)1 AddXSDEnumerationFacetAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction)1 AddXSDModelGroupAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction)1 AddXSDModelGroupDefinitionAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction)1 AddXSDRedefinedAttributeGroupAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction)1 AddXSDRedefinedComplexTypeAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction)1 AddXSDRedefinedModelGroupAction (org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction)1