diff options
author | dstadnik | 2007-01-04 15:32:29 +0000 |
---|---|---|
committer | dstadnik | 2007-01-04 15:32:29 +0000 |
commit | a0266f1f0209bfeabfd4047223d38a2b7726238e (patch) | |
tree | 0c1620bee39e08d40d19ea1c187d314c44c45c8d | |
parent | 05a431020ab326f83489074185e167f9a676b553 (diff) | |
download | org.eclipse.gmf-tooling-a0266f1f0209bfeabfd4047223d38a2b7726238e.tar.gz org.eclipse.gmf-tooling-a0266f1f0209bfeabfd4047223d38a2b7726238e.tar.xz org.eclipse.gmf-tooling-a0266f1f0209bfeabfd4047223d38a2b7726238e.zip |
rewrite plugin.xml template in xpand
-rw-r--r-- | plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/properties/extensions.xpt | 144 | ||||
-rw-r--r-- | plugins/org.eclipse.gmf.codegen/templates/xpt/plugin.xpt | 153 |
2 files changed, 296 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/properties/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/properties/extensions.xpt new file mode 100644 index 000000000..ab5f0dfd5 --- /dev/null +++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/properties/extensions.xpt @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2007 Borland Software Corporation + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Dmitry Stadnik (Borland) - initial API and implementation + */ + +«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"» +«IMPORT "http://www.eclipse.org/emf/2002/Ecore"» + +«DEFINE extensions FOR gmfgen::GenPropertySheet-» +<%final GenPropertySheet propSheet = editorGen.getPropertySheet(); +final String contributorID = genPlugin.getID();%> + + <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor"> + <?gmfgen generated="true"?> + <propertyContributor contributorId="«editorGen.plugin.iD»" + «IF needsCaption-» + labelProvider="«getLabelProviderQualifiedClassName()»" + «ENDIF-» + > + <propertyCategory category="domain"/> + <propertyCategory category="visual"/> + <propertyCategory category="extra"/> + </propertyContributor> + </extension> + + <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> + <?gmfgen generated="true"?> + <propertyTabs contributorId="«editorGen.plugin.iD»"> + «FOREACH tabs AS tab-» + «EXPAND tab FOR tab-» + «ENDFOREACH-» + </propertyTabs> + </extension> + + <extension point="org.eclipse.ui.views.properties.tabbed.propertySections"> + <?gmfgen generated="true"?> + <propertySections contributorId="«editorGen.plugin.iD»"> + «FOREACH tabs AS tab-» + «EXPAND section FOR tab-» + «ENDFOREACH-» + </propertySections> + </extension> +«ENDDEFINE» + +«DEFINE tab FOR gmfgen::GenPropertyTab» + «ERROR "Unknown property tab: " + this» +«ENDDEFINE» + +«DEFINE tab FOR gmfgen::GenStandardPropertyTab» + «IF iD == "appearance"-» + <propertyTab + category="visual" + id="property.tab.AppearancePropertySection" + label="%tab.appearance"/> + «ELSEIF iD == "diagram"-» + <propertyTab + category="visual" + id="property.tab.DiagramPropertySection" + label="%tab.diagram"/> + «ELSEIF iD == "advanced"-» + <propertyTab + category="extra" + id="property.tab.AdvancedPropertySection" + label="%tab.advanced"/> + «ENDIF-» +«ENDDEFINE» + +«DEFINE tab FOR gmfgen::GenCustomPropertyTab» + <propertyTab + «IF iD == "domain"-» + category="domain" + «ELSE-» + category="extra" + «ENDIF-» + id="property.tab.«iD»" + label="%tab.«iD»"/> +«ENDDEFINE» + +«DEFINE section FOR gmfgen::GenPropertyTab» + «ERROR "Unknown property tab: " + this» +«ENDDEFINE» + +«DEFINE section FOR gmfgen::GenStandardPropertyTab» + «IF iD == "appearance"-» + <propertySection id="property.section.ConnectorAppearancePropertySection" + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter" + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection" + tab="property.tab.AppearancePropertySection"> + </propertySection> + <propertySection id="property.section.ShapeColorAndFontPropertySection" + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter" + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection" + tab="property.tab.AppearancePropertySection"> + </propertySection> + <propertySection id="property.section.DiagramColorsAndFontsPropertySection" + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection" + tab="property.tab.AppearancePropertySection"> + </propertySection> + «ELSEIF iD == "diagram"-» + <propertySection id="property.section.RulerGridPropertySection" + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection" + tab="property.tab.DiagramPropertySection"> + </propertySection> + «ELSEIF iD == "advanced"-» + <propertySection id="property.section.AdvancedPropertySection" + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection" + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.EditPartPropertySectionFilter" + tab="property.tab.AdvancedPropertySection"> + </propertySection> + «ENDIF-» +«ENDDEFINE» + +«DEFINE section FOR gmfgen::GenCustomPropertyTab» + <propertySection + id="property.section.«iD»" + tab="property.tab.«iD»" + «EXPAND filter FOR filter-» + class="«getQualifiedClassName()»"> + «EXPAND input FOR filter-» + </propertySection> +«ENDDEFINE» + +«DEFINE filter FOR gmfgen::GenPropertyTabFilter»«ENDDEFINE» + +«DEFINE filter FOR gmfgen::CustomTabFilter» + filter="«getQualifiedClassName()»" +«ENDDEFINE» + +«DEFINE input FOR gmfgen::GenPropertyTabFilter»«ENDDEFINE» + +«DEFINE input FOR gmfgen::TypeTabFilter» + «FOREACH getAllTypes() AS type-» + <input type="«type»"/> + «ENDFOREACH-» +«ENDDEFINE» diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/plugin.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/plugin.xpt index 67bc8e7d7..848ede38a 100644 --- a/plugins/org.eclipse.gmf.codegen/templates/xpt/plugin.xpt +++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/plugin.xpt @@ -35,8 +35,159 @@ </parser> </extension> - «EXPAND xpt::diagram::preferences::extensions::extensions FOR editorGen.diagram-» «EXPAND xpt::editor::extensions::extensions FOR editorGen-» + «EXPAND contextMenu-» + «EXPAND providers FOR editorGen.diagram-» + «EXPAND xpt::diagram::preferences::extensions::extensions FOR editorGen.diagram-» + «EXPAND xpt::diagram::properties::extensions::extensions FOR editorGen.propertySheet-» «EXPAND xpt::application::extensions::extensions FOR editorGen.application-» </plugin> «ENDDEFINE» + +«DEFINE contextMenu FOR gmfgen::GenPlugin» + <extension point="org.eclipse.ui.popupMenus"> + <?gmfgen generated="true"?> + «IF null == editorGen.application && editorGen.diagram.generateInitDiagramAction()-» + <objectContribution + id="«iD».ui.objectContribution.IFile1" + nameFilter="*.«editorGen.domainFileExtension»" + objectClass="org.eclipse.core.resources.IFile"> + <action + label="%initDiagramActionLabel" + class="«editorGen.diagram.getInitDiagramFileActionQualifiedClassName()»" + menubarPath="additions" + enablesFor="1" + id="«editorGen.diagram.getInitDiagramFileActionQualifiedClassName()»ID"> + </action> + </objectContribution> + «ENDIF-» + «IF null == editorGen.application && editorGen.diagram.generateCreateShortcutAction()-» + <objectContribution + adaptable="false" + id="«iD».ui.objectContribution.«editorGen.diagram.editPartClassName»1" + objectClass="«editorGen.diagram.getEditPartQualifiedClassName()»"> + <action + class="«editorGen.diagram.getCreateShortcutActionQualifiedClassName()»" + enablesFor="1" + id="«editorGen.diagram.getCreateShortcutActionQualifiedClassName()»ID" + label="%createShortcutActionLabel" + menubarPath="additions"> + </action> + </objectContribution> + «ENDIF-» + <objectContribution + adaptable="false" + id="«iD».ui.objectContribution.«editorGen.diagram.editPartClassName»2" + objectClass="«editorGen.diagram.getEditPartQualifiedClassName()»"> + <action + class="«editorGen.diagram.getLoadResourceActionQualifiedClassName()»" + enablesFor="1" + id="«editorGen.diagram.getLoadResourceActionQualifiedClassName()»ID" + label="%loadResourceActionLabel" + menubarPath="additions"> + </action> + </objectContribution> + </extension> + + <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders"> + <?gmfgen generated="true"?> + <GlobalActionHandlerProvider + class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandlerProvider" + id="«editorGen.modelID»Presentation"> + <Priority name="Lowest"/> + <ViewId id="«editorGen.editor.iD»"> + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + <GlobalActionId actionId="delete"/> + </ElementType> + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart"> + <GlobalActionId actionId="save"/> + </ElementType> + </ViewId> + </GlobalActionHandlerProvider> + «IF printingEnabled-» + <GlobalActionHandlerProvider + class="org.eclipse.gmf.runtime.diagram.ui.printing.render.providers.DiagramWithPrintGlobalActionHandlerProvider" + id="«editorGen.modelID»PresentationPrint"> + <Priority name="Lowest"/> + <ViewId id="«editorGen.editor.iD»"> + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + <GlobalActionId actionId="print"/> + </ElementType> + </ViewId> + </GlobalActionHandlerProvider> + «ENDIF-» + «IF null == editorGen.application-» + <GlobalActionHandlerProvider + class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider" + id="«editorGen.modelID»PresentationIDE"> + <Priority name="Lowest"/> + <ViewId id="«editorGen.editor.iD»"> + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + <GlobalActionId actionId="bookmark"/> + </ElementType> + </ViewId> + </GlobalActionHandlerProvider> + «ENDIF-» + <GlobalActionHandlerProvider + class="org.eclipse.gmf.runtime.diagram.ui.render.providers.DiagramUIRenderGlobalActionHandlerProvider" + id="«editorGen.modelID»Render"> + <Priority name="Lowest"/> + <ViewId id="«editorGen.editor.iD»"> + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> + <GlobalActionId actionId="cut"/> + <GlobalActionId actionId="copy"/> + <GlobalActionId actionId="paste"/> + </ElementType> + </ViewId> + </GlobalActionHandlerProvider> + </extension> +«ENDDEFINE» + +«DEFINE providers FOR gmfgen::GenDiagram» + <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders"> + <?gmfgen generated="true"?> + <viewProvider class="«getNotationViewProviderQualifiedClassName()»"> + <Priority name="«notationViewProviderPriority»"/> + <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="«editorGen.modelID»"/> + <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints=""/> + <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints=""/> + </viewProvider> + </extension> + + <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders"> + <?gmfgen generated="true"?> + <editpartProvider class="«getEditPartProviderQualifiedClassName()»"> + <Priority name="«editPartProviderPriority»"/> + </editpartProvider> + </extension> + + <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders"> + <?gmfgen generated="true"?> + <modelingAssistantProvider class="«getModelingAssistantProviderQualifiedClassName()»"> + <Priority name="«modelingAssistantProviderPriority»"/> + </modelingAssistantProvider> + </extension> + + <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders"> + <?gmfgen generated="true"?> + <IconProvider class="«getIconProviderQualifiedClassName()»"> + <Priority name="«iconProviderPriority»"/> + </IconProvider> + </extension> + + <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders"> + <?gmfgen generated="true"?> + <ParserProvider class="«getParserProviderQualifiedClassName()»"> + <Priority name="«parserProviderPriority»"/> + </ParserProvider> + </extension> + «IF generateShortcutIcon()-» + + <extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"> + <?gmfgen generated="true"?> + <decoratorProvider class="«getShortcutsDecoratorProviderQualifiedClassName()»"> + <Priority name="«shortcutsDecoratorProviderPriority»"/> + </decoratorProvider> + </extension> + «ENDIF-» +«ENDDEFINE» |