Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ee5b4782528c112d3974b81106ff142a65f4a2bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*
 * Copyright (c) 2007, 2010 Borland Software Corporation and others
 * 
 * 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/2009/GenModel'»
«EXTENSION xpt::diagram::Utils»

«DEFINE extensions FOR gmfgen::GenDiagram-»

   <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <viewProvider class="«getNotationViewProviderQualifiedClassName()»">
         <Priority name="«notationViewProviderPriority»"/>
«IF shortcutsProvidedFor->notEmpty() /*allow provider activation when another diagram tries to create a node, perhaps ours*/-»
         <object id="referencing-diagrams" class="org.eclipse.gmf.runtime.notation.Diagram">
            <method name="getType()" value="«FOREACH shortcutsProvidedFor AS s SEPARATOR ','»«s»«ENDFOREACH»"/>
         </object>
         <context viewClass="org.eclipse.gmf.runtime.notation.Node" containerViews="referencing-diagrams"/>
«ENDIF-»
         <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="«editorGen.modelID»"/>
         <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="«FOREACH getAllNodes() /*XXX can further improve selection using containerViews attribute, however, when top-node is created, provider is activated and this xml is not consulted any longer*/ AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
«IF links->notEmpty() /*it is unlikely there would be a diagram without a node, but a diagram without links deemed possible */-»
         <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="«FOREACH links AS l SEPARATOR ','»«l.visualID»«ENDFOREACH»"/>
«ENDIF-»
      </viewProvider>
   </extension>

   <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <editpartProvider class="«getEditPartProviderQualifiedClassName()»">
         <Priority name="«editPartProviderPriority»"/>
         <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
            <method name="getType()" value="«editorGen.modelID»"/>
         </object>
         <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
            <method name="getType()" value="«FOREACH getAllNodes() AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
         </object>
         <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
            <method name="getType()" value="«FOREACH links AS l SEPARATOR ','»«l.visualID»«ENDFOREACH»"/>
         </object>
         <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
            <method name="getType()" value="«FOREACH getAllNodes().labels AS lb SEPARATOR ','»«lb.visualID»«ENDFOREACH»"/>
         </object>
         <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
            <method name="getType()" value="«FOREACH compartments AS c SEPARATOR ','»«c.visualID»«ENDFOREACH»"/>
         </object>
         <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
      </editpartProvider>
   </extension>

«EXPAND modelingAssistantProvider»
«FOREACH getAllNodes() AS n-»
	«EXPAND modelingAssistantProvider FOR n»
«ENDFOREACH-»

   <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <IconProvider class="«getIconProviderQualifiedClassName()»">
         <Priority name="«iconProviderPriority»"/>
      </IconProvider>
   </extension>
«IF editorGen.labelParsers <> null and editorGen.labelParsers.extensibleViaService»
   <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <ParserProvider class="«editorGen.labelParsers.getQualifiedClassName()»">
         <Priority name="«editorGen.labelParsers.providerPriority»"/>
      </ParserProvider>
   </extension>
«ENDIF-»
«IF generateShortcutIcon()»
   <extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders" id="decorator-provider">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <decoratorProvider class="«getShortcutsDecoratorProviderQualifiedClassName()»">
         <Priority name="«shortcutsDecoratorProviderPriority»"/>
         <object class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" id="generated-top-nodes">
            <method name="getType()" value="«FOREACH topLevelNodes->asSequence() /*generated code supports shortcuts only to top-level nodes*/ AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
         </object>
         <context decoratorTargets="generated-top-nodes"/>
      </decoratorProvider>
   </extension>
«ENDIF-»

   <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
      «EXPAND xpt::Common::xmlGeneratedTag»
«FOREACH getAllTypedElements() AS e-»
«EXPAND elementTypeSafe FOR e.elementType-»
«ENDFOREACH-»
   </extension>

   <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
      «EXPAND xpt::Common::xmlGeneratedTag»
      <clientContext id="«editorGen.plugin.iD».TypeContext">
         <enablement>
            <test
               property="org.eclipse.gmf.runtime.emf.core.editingDomain"
               value="«editingDomainID»"/>
         </enablement>
      </clientContext> 
      <binding context="«editorGen.plugin.iD».TypeContext">
«FOREACH getAllTypedElements() AS e-»
         <elementType ref="«e.elementType.uniqueIdentifier»"/>
«ENDFOREACH-»
         <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
      </binding>
   </extension>
«ENDDEFINE»

«DEFINE elementTypeSafe FOR gmfgen::ElementType-»
«IF not definedExternally-»
«EXPAND elementType-»
«ENDIF-»
«ENDDEFINE»

«DEFINE elementType FOR gmfgen::ElementType»
«ERROR 'Unknown element type: ' + self.repr()»
«ENDDEFINE»

«DEFINE elementType FOR gmfgen::MetamodelType-»
      <metamodel nsURI="«getMetaClass().genPackage.ecorePackage.nsURI»">
         <metamodelType
               id="«uniqueIdentifier»"
«IF null <> displayName-»
               name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
               eclass="«getMetaClass().ecoreClass.name»"
               edithelper="«getEditHelperQualifiedClassName()»">
            <param name="semanticHint" value="«diagramElement.visualID»"/>
         </metamodelType>
      </metamodel>
«ENDDEFINE»

«DEFINE elementType FOR gmfgen::SpecializationType-»
«IF null = getMetamodelClass()-»
«EXPAND specializationType-»
«ELSE-»
      <metamodel nsURI="«getMetamodelClass().genPackage.ecorePackage.nsURI»">
«EXPAND specializationType-»
      </metamodel>
«ENDIF-»
«ENDDEFINE»

«DEFINE specializationType FOR gmfgen::SpecializationType-»
         <specializationType
               id="«uniqueIdentifier»"
«IF null <> displayName-»
               name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"«IF editHelperAdviceClassName <> null»
               edithelperadvice="«getEditHelperAdviceQualifiedClassName()»"«ENDIF»>
            <specializes id="«(if null = metamodelType then 'org.eclipse.gmf.runtime.emf.type.core.null' else metamodelType.uniqueIdentifier endif)»"/>
            <param name="semanticHint" value="«diagramElement.visualID»"/>
         </specializationType>
«ENDDEFINE»

«DEFINE elementType FOR gmfgen::NotationType-»
      <specializationType
            id="«uniqueIdentifier»"
«IF null <> displayName-»
            name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
            kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
         <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
         <param name="semanticHint" value="«diagramElement.visualID»"/>
      </specializationType>
«ENDDEFINE»

«DEFINE i18n FOR gmfgen::GenDiagram-»

# Providers
«EXPAND internal_i18n FOREACH getAllTypedElements().elementType»
«ENDDEFINE»

«DEFINE internal_i18n FOR gmfgen::ElementType-»
«IF null <> displayName and not definedExternally»metatype.name.«diagramElement.getUniqueIdentifier()»=«displayName»«ENDIF»
«ENDDEFINE»

«DEFINE modelingAssistantProvider FOR gmfgen::GenContainerBase»
	<extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider-«visualID»">
		«EXPAND xpt::Common::xmlGeneratedTag»
		<modelingAssistantProvider class="«EXPAND modelingAssistantProviderQualifiedClassName»">
			<Priority name="«getDiagram().modelingAssistantProviderPriority»"/>
			<object class="«getEditPartQualifiedClassName()»" id="«getUniqueIdentifier()»"/>         
			<context elements="«getUniqueIdentifier()»»"/>
		</modelingAssistantProvider>
	</extension>
«ENDDEFINE»

«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenContainerBase»«REM»NO-OP, all specific subclasses should be handled«ENDREM»«ENDDEFINE»

«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenDiagram»«getModelingAssistantProviderQualifiedClassName()»«ENDDEFINE»

«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenNode»«EXPAND xpt::providers::EditPartModelingAssistantProvider::qualifiedClassName»«ENDDEFINE»


Back to the top