1 | /* |
2 | *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.navigator; |
5 | |
6 | import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; |
7 | import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; |
8 | import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; |
9 | import org.eclipse.gmf.runtime.emf.type.core.IElementType; |
10 | import org.eclipse.gmf.runtime.notation.View; |
11 | import org.eclipse.jface.resource.ImageDescriptor; |
12 | import org.eclipse.jface.resource.ImageRegistry; |
13 | import org.eclipse.jface.viewers.ITreePathLabelProvider; |
14 | import org.eclipse.jface.viewers.LabelProvider; |
15 | import org.eclipse.jface.viewers.TreePath; |
16 | import org.eclipse.jface.viewers.ViewerLabel; |
17 | import org.eclipse.swt.graphics.Image; |
18 | import org.eclipse.ui.IMemento; |
19 | import org.eclipse.ui.navigator.ICommonContentExtensionSite; |
20 | import org.eclipse.ui.navigator.ICommonLabelProvider; |
21 | |
22 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyConnector; |
23 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyEventConnector; |
24 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyInfrastructureConnector; |
25 | import de.uka.ipd.sdq.pcm.core.composition.ProvidedDelegationConnector; |
26 | import de.uka.ipd.sdq.pcm.core.composition.RequiredDelegationConnector; |
27 | import de.uka.ipd.sdq.pcm.core.entity.ComposedProvidingRequiringEntity; |
28 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyConnectorEditPart; |
29 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyContextEditPart; |
30 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyContextEntityNameEditPart; |
31 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyEventConnectorEditPart; |
32 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.AssemblyInfrastructureConnectorEditPart; |
33 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntity2EditPart; |
34 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntityEditPart; |
35 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntityEntityNameEditPart; |
36 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureProvidedRoleEditPart; |
37 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureProvidedRoleEntityNameEditPart; |
38 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureRequiredRoleEditPart; |
39 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.InfrastructureRequiredRoleEntityNameEditPart; |
40 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRole2EditPart; |
41 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRoleEditPart; |
42 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRoleEntityName2EditPart; |
43 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationProvidedRoleEntityNameEditPart; |
44 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRole2EditPart; |
45 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRoleEditPart; |
46 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRoleEntityName2EditPart; |
47 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.OperationRequiredRoleEntityNameEditPart; |
48 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ProvidedDelegationConnectorEditPart; |
49 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.RequiredDelegationConnectorEditPart; |
50 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SinkRoleEditPart; |
51 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SinkRoleEntityNameEditPart; |
52 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SourceRoleEditPart; |
53 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.SourceRoleEntityNameEditPart; |
54 | import de.uka.ipd.sdq.pcm.gmf.composite.part.PalladioComponentModelComposedStructureDiagramEditorPlugin; |
55 | import de.uka.ipd.sdq.pcm.gmf.composite.part.PalladioComponentModelVisualIDRegistry; |
56 | import de.uka.ipd.sdq.pcm.gmf.composite.providers.PalladioComponentModelElementTypes; |
57 | import de.uka.ipd.sdq.pcm.gmf.composite.providers.PalladioComponentModelParserProvider; |
58 | |
59 | /** |
60 | * @generated |
61 | */ |
62 | public class PalladioComponentModelNavigatorLabelProvider extends LabelProvider |
63 | implements ICommonLabelProvider, ITreePathLabelProvider { |
64 | |
65 | /** |
66 | * @generated |
67 | */ |
68 | static { |
69 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
70 | .getInstance() |
71 | .getImageRegistry() |
72 | .put( |
73 | "Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ |
74 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
75 | .getInstance() |
76 | .getImageRegistry() |
77 | .put( |
78 | "Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ |
79 | } |
80 | |
81 | /** |
82 | * @generated |
83 | */ |
84 | public void updateLabel(ViewerLabel label, TreePath elementPath) { |
85 | Object element = elementPath.getLastSegment(); |
86 | if (element instanceof PalladioComponentModelNavigatorItem |
87 | && !isOwnView(((PalladioComponentModelNavigatorItem) element) |
88 | .getView())) { |
89 | return; |
90 | } |
91 | label.setText(getText(element)); |
92 | label.setImage(getImage(element)); |
93 | } |
94 | |
95 | /** |
96 | * @generated |
97 | */ |
98 | public Image getImage(Object element) { |
99 | if (element instanceof PalladioComponentModelNavigatorGroup) { |
100 | PalladioComponentModelNavigatorGroup group = (PalladioComponentModelNavigatorGroup) element; |
101 | return PalladioComponentModelComposedStructureDiagramEditorPlugin |
102 | .getInstance().getBundledImage(group.getIcon()); |
103 | } |
104 | |
105 | if (element instanceof PalladioComponentModelNavigatorItem) { |
106 | PalladioComponentModelNavigatorItem navigatorItem = (PalladioComponentModelNavigatorItem) element; |
107 | if (!isOwnView(navigatorItem.getView())) { |
108 | return super.getImage(element); |
109 | } |
110 | return getImage(navigatorItem.getView()); |
111 | } |
112 | |
113 | return super.getImage(element); |
114 | } |
115 | |
116 | /** |
117 | * @generated |
118 | */ |
119 | public Image getImage(View view) { |
120 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
121 | case ComposedProvidingRequiringEntityEditPart.VISUAL_ID: |
122 | return getImage( |
123 | "Navigator?Diagram?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Entity/4.0?ComposedProvidingRequiringEntity", PalladioComponentModelElementTypes.ComposedProvidingRequiringEntity_1000); //$NON-NLS-1$ |
124 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
125 | return getImage( |
126 | "Navigator?TopLevelNode?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Entity/4.0?ComposedProvidingRequiringEntity", PalladioComponentModelElementTypes.ComposedProvidingRequiringEntity_2002); //$NON-NLS-1$ |
127 | case AssemblyContextEditPart.VISUAL_ID: |
128 | return getImage( |
129 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?AssemblyContext", PalladioComponentModelElementTypes.AssemblyContext_3006); //$NON-NLS-1$ |
130 | case OperationProvidedRoleEditPart.VISUAL_ID: |
131 | return getImage( |
132 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?OperationProvidedRole", PalladioComponentModelElementTypes.OperationProvidedRole_3007); //$NON-NLS-1$ |
133 | case OperationRequiredRoleEditPart.VISUAL_ID: |
134 | return getImage( |
135 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?OperationRequiredRole", PalladioComponentModelElementTypes.OperationRequiredRole_3008); //$NON-NLS-1$ |
136 | case SourceRoleEditPart.VISUAL_ID: |
137 | return getImage( |
138 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?SourceRole", PalladioComponentModelElementTypes.SourceRole_3013); //$NON-NLS-1$ |
139 | case SinkRoleEditPart.VISUAL_ID: |
140 | return getImage( |
141 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?SinkRole", PalladioComponentModelElementTypes.SinkRole_3014); //$NON-NLS-1$ |
142 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
143 | return getImage( |
144 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?InfrastructureProvidedRole", PalladioComponentModelElementTypes.InfrastructureProvidedRole_3015); //$NON-NLS-1$ |
145 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
146 | return getImage( |
147 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?InfrastructureRequiredRole", PalladioComponentModelElementTypes.InfrastructureRequiredRole_3016); //$NON-NLS-1$ |
148 | case OperationProvidedRole2EditPart.VISUAL_ID: |
149 | return getImage( |
150 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?OperationProvidedRole", PalladioComponentModelElementTypes.OperationProvidedRole_3011); //$NON-NLS-1$ |
151 | case OperationRequiredRole2EditPart.VISUAL_ID: |
152 | return getImage( |
153 | "Navigator?Node?http://sdq.ipd.uka.de/PalladioComponentModel/Repository/4.0?OperationRequiredRole", PalladioComponentModelElementTypes.OperationRequiredRole_3012); //$NON-NLS-1$ |
154 | case AssemblyConnectorEditPart.VISUAL_ID: |
155 | return getImage( |
156 | "Navigator?Link?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?AssemblyConnector", PalladioComponentModelElementTypes.AssemblyConnector_4004); //$NON-NLS-1$ |
157 | case AssemblyEventConnectorEditPart.VISUAL_ID: |
158 | return getImage( |
159 | "Navigator?Link?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?AssemblyEventConnector", PalladioComponentModelElementTypes.AssemblyEventConnector_4007); //$NON-NLS-1$ |
160 | case RequiredDelegationConnectorEditPart.VISUAL_ID: |
161 | return getImage( |
162 | "Navigator?Link?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?RequiredDelegationConnector", PalladioComponentModelElementTypes.RequiredDelegationConnector_4005); //$NON-NLS-1$ |
163 | case ProvidedDelegationConnectorEditPart.VISUAL_ID: |
164 | return getImage( |
165 | "Navigator?Link?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?ProvidedDelegationConnector", PalladioComponentModelElementTypes.ProvidedDelegationConnector_4006); //$NON-NLS-1$ |
166 | case AssemblyInfrastructureConnectorEditPart.VISUAL_ID: |
167 | return getImage( |
168 | "Navigator?Link?http://sdq.ipd.uka.de/PalladioComponentModel/Core/Composition/4.0?AssemblyInfrastructureConnector", PalladioComponentModelElementTypes.AssemblyInfrastructureConnector_4008); //$NON-NLS-1$ |
169 | } |
170 | return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$ |
171 | } |
172 | |
173 | /** |
174 | * @generated |
175 | */ |
176 | private Image getImage(String key, IElementType elementType) { |
177 | ImageRegistry imageRegistry = PalladioComponentModelComposedStructureDiagramEditorPlugin |
178 | .getInstance().getImageRegistry(); |
179 | Image image = imageRegistry.get(key); |
180 | if (image == null |
181 | && elementType != null |
182 | && PalladioComponentModelElementTypes |
183 | .isKnownElementType(elementType)) { |
184 | image = PalladioComponentModelElementTypes.getImage(elementType); |
185 | imageRegistry.put(key, image); |
186 | } |
187 | |
188 | if (image == null) { |
189 | image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$ |
190 | imageRegistry.put(key, image); |
191 | } |
192 | return image; |
193 | } |
194 | |
195 | /** |
196 | * @generated |
197 | */ |
198 | public String getText(Object element) { |
199 | if (element instanceof PalladioComponentModelNavigatorGroup) { |
200 | PalladioComponentModelNavigatorGroup group = (PalladioComponentModelNavigatorGroup) element; |
201 | return group.getGroupName(); |
202 | } |
203 | |
204 | if (element instanceof PalladioComponentModelNavigatorItem) { |
205 | PalladioComponentModelNavigatorItem navigatorItem = (PalladioComponentModelNavigatorItem) element; |
206 | if (!isOwnView(navigatorItem.getView())) { |
207 | return null; |
208 | } |
209 | return getText(navigatorItem.getView()); |
210 | } |
211 | |
212 | return super.getText(element); |
213 | } |
214 | |
215 | /** |
216 | * @generated |
217 | */ |
218 | public String getText(View view) { |
219 | if (view.getElement() != null && view.getElement().eIsProxy()) { |
220 | return getUnresolvedDomainElementProxyText(view); |
221 | } |
222 | switch (PalladioComponentModelVisualIDRegistry.getVisualID(view)) { |
223 | case ComposedProvidingRequiringEntityEditPart.VISUAL_ID: |
224 | return getComposedProvidingRequiringEntity_1000Text(view); |
225 | case ComposedProvidingRequiringEntity2EditPart.VISUAL_ID: |
226 | return getComposedProvidingRequiringEntity_2002Text(view); |
227 | case AssemblyContextEditPart.VISUAL_ID: |
228 | return getAssemblyContext_3006Text(view); |
229 | case OperationProvidedRoleEditPart.VISUAL_ID: |
230 | return getOperationProvidedRole_3007Text(view); |
231 | case OperationRequiredRoleEditPart.VISUAL_ID: |
232 | return getOperationRequiredRole_3008Text(view); |
233 | case SourceRoleEditPart.VISUAL_ID: |
234 | return getSourceRole_3013Text(view); |
235 | case SinkRoleEditPart.VISUAL_ID: |
236 | return getSinkRole_3014Text(view); |
237 | case InfrastructureProvidedRoleEditPart.VISUAL_ID: |
238 | return getInfrastructureProvidedRole_3015Text(view); |
239 | case InfrastructureRequiredRoleEditPart.VISUAL_ID: |
240 | return getInfrastructureRequiredRole_3016Text(view); |
241 | case OperationProvidedRole2EditPart.VISUAL_ID: |
242 | return getOperationProvidedRole_3011Text(view); |
243 | case OperationRequiredRole2EditPart.VISUAL_ID: |
244 | return getOperationRequiredRole_3012Text(view); |
245 | case AssemblyConnectorEditPart.VISUAL_ID: |
246 | return getAssemblyConnector_4004Text(view); |
247 | case AssemblyEventConnectorEditPart.VISUAL_ID: |
248 | return getAssemblyEventConnector_4007Text(view); |
249 | case RequiredDelegationConnectorEditPart.VISUAL_ID: |
250 | return getRequiredDelegationConnector_4005Text(view); |
251 | case ProvidedDelegationConnectorEditPart.VISUAL_ID: |
252 | return getProvidedDelegationConnector_4006Text(view); |
253 | case AssemblyInfrastructureConnectorEditPart.VISUAL_ID: |
254 | return getAssemblyInfrastructureConnector_4008Text(view); |
255 | } |
256 | return getUnknownElementText(view); |
257 | } |
258 | |
259 | /** |
260 | * @generated |
261 | */ |
262 | private String getComposedProvidingRequiringEntity_1000Text(View view) { |
263 | ComposedProvidingRequiringEntity domainModelElement = (ComposedProvidingRequiringEntity) view |
264 | .getElement(); |
265 | if (domainModelElement != null) { |
266 | return domainModelElement.getId(); |
267 | } else { |
268 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
269 | .getInstance() |
270 | .logError( |
271 | "No domain element for view with visualID = " + 1000); //$NON-NLS-1$ |
272 | return ""; //$NON-NLS-1$ |
273 | } |
274 | } |
275 | |
276 | /** |
277 | * @generated |
278 | */ |
279 | private String getComposedProvidingRequiringEntity_2002Text(View view) { |
280 | IParser parser = PalladioComponentModelParserProvider |
281 | .getParser( |
282 | PalladioComponentModelElementTypes.ComposedProvidingRequiringEntity_2002, |
283 | view.getElement() != null ? view.getElement() : view, |
284 | PalladioComponentModelVisualIDRegistry |
285 | .getType(ComposedProvidingRequiringEntityEntityNameEditPart.VISUAL_ID)); |
286 | if (parser != null) { |
287 | return parser.getPrintString(new EObjectAdapter( |
288 | view.getElement() != null ? view.getElement() : view), |
289 | ParserOptions.NONE.intValue()); |
290 | } else { |
291 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
292 | .getInstance().logError( |
293 | "Parser was not found for label " + 5012); //$NON-NLS-1$ |
294 | return ""; //$NON-NLS-1$ |
295 | } |
296 | } |
297 | |
298 | /** |
299 | * @generated |
300 | */ |
301 | private String getAssemblyContext_3006Text(View view) { |
302 | IParser parser = PalladioComponentModelParserProvider.getParser( |
303 | PalladioComponentModelElementTypes.AssemblyContext_3006, view |
304 | .getElement() != null ? view.getElement() : view, |
305 | PalladioComponentModelVisualIDRegistry |
306 | .getType(AssemblyContextEntityNameEditPart.VISUAL_ID)); |
307 | if (parser != null) { |
308 | return parser.getPrintString(new EObjectAdapter( |
309 | view.getElement() != null ? view.getElement() : view), |
310 | ParserOptions.NONE.intValue()); |
311 | } else { |
312 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
313 | .getInstance().logError( |
314 | "Parser was not found for label " + 5009); //$NON-NLS-1$ |
315 | return ""; //$NON-NLS-1$ |
316 | } |
317 | } |
318 | |
319 | /** |
320 | * @generated |
321 | */ |
322 | private String getOperationProvidedRole_3007Text(View view) { |
323 | IParser parser = PalladioComponentModelParserProvider |
324 | .getParser( |
325 | PalladioComponentModelElementTypes.OperationProvidedRole_3007, |
326 | view.getElement() != null ? view.getElement() : view, |
327 | PalladioComponentModelVisualIDRegistry |
328 | .getType(OperationProvidedRoleEntityNameEditPart.VISUAL_ID)); |
329 | if (parser != null) { |
330 | return parser.getPrintString(new EObjectAdapter( |
331 | view.getElement() != null ? view.getElement() : view), |
332 | ParserOptions.NONE.intValue()); |
333 | } else { |
334 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
335 | .getInstance().logError( |
336 | "Parser was not found for label " + 5007); //$NON-NLS-1$ |
337 | return ""; //$NON-NLS-1$ |
338 | } |
339 | } |
340 | |
341 | /** |
342 | * @generated |
343 | */ |
344 | private String getOperationRequiredRole_3008Text(View view) { |
345 | IParser parser = PalladioComponentModelParserProvider |
346 | .getParser( |
347 | PalladioComponentModelElementTypes.OperationRequiredRole_3008, |
348 | view.getElement() != null ? view.getElement() : view, |
349 | PalladioComponentModelVisualIDRegistry |
350 | .getType(OperationRequiredRoleEntityNameEditPart.VISUAL_ID)); |
351 | if (parser != null) { |
352 | return parser.getPrintString(new EObjectAdapter( |
353 | view.getElement() != null ? view.getElement() : view), |
354 | ParserOptions.NONE.intValue()); |
355 | } else { |
356 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
357 | .getInstance().logError( |
358 | "Parser was not found for label " + 5008); //$NON-NLS-1$ |
359 | return ""; //$NON-NLS-1$ |
360 | } |
361 | } |
362 | |
363 | /** |
364 | * @generated |
365 | */ |
366 | private String getSourceRole_3013Text(View view) { |
367 | IParser parser = PalladioComponentModelParserProvider.getParser( |
368 | PalladioComponentModelElementTypes.SourceRole_3013, view |
369 | .getElement() != null ? view.getElement() : view, |
370 | PalladioComponentModelVisualIDRegistry |
371 | .getType(SourceRoleEntityNameEditPart.VISUAL_ID)); |
372 | if (parser != null) { |
373 | return parser.getPrintString(new EObjectAdapter( |
374 | view.getElement() != null ? view.getElement() : view), |
375 | ParserOptions.NONE.intValue()); |
376 | } else { |
377 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
378 | .getInstance().logError( |
379 | "Parser was not found for label " + 5015); //$NON-NLS-1$ |
380 | return ""; //$NON-NLS-1$ |
381 | } |
382 | } |
383 | |
384 | /** |
385 | * @generated |
386 | */ |
387 | private String getSinkRole_3014Text(View view) { |
388 | IParser parser = PalladioComponentModelParserProvider.getParser( |
389 | PalladioComponentModelElementTypes.SinkRole_3014, view |
390 | .getElement() != null ? view.getElement() : view, |
391 | PalladioComponentModelVisualIDRegistry |
392 | .getType(SinkRoleEntityNameEditPart.VISUAL_ID)); |
393 | if (parser != null) { |
394 | return parser.getPrintString(new EObjectAdapter( |
395 | view.getElement() != null ? view.getElement() : view), |
396 | ParserOptions.NONE.intValue()); |
397 | } else { |
398 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
399 | .getInstance().logError( |
400 | "Parser was not found for label " + 5016); //$NON-NLS-1$ |
401 | return ""; //$NON-NLS-1$ |
402 | } |
403 | } |
404 | |
405 | /** |
406 | * @generated |
407 | */ |
408 | private String getInfrastructureProvidedRole_3015Text(View view) { |
409 | IParser parser = PalladioComponentModelParserProvider |
410 | .getParser( |
411 | PalladioComponentModelElementTypes.InfrastructureProvidedRole_3015, |
412 | view.getElement() != null ? view.getElement() : view, |
413 | PalladioComponentModelVisualIDRegistry |
414 | .getType(InfrastructureProvidedRoleEntityNameEditPart.VISUAL_ID)); |
415 | if (parser != null) { |
416 | return parser.getPrintString(new EObjectAdapter( |
417 | view.getElement() != null ? view.getElement() : view), |
418 | ParserOptions.NONE.intValue()); |
419 | } else { |
420 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
421 | .getInstance().logError( |
422 | "Parser was not found for label " + 5017); //$NON-NLS-1$ |
423 | return ""; //$NON-NLS-1$ |
424 | } |
425 | } |
426 | |
427 | /** |
428 | * @generated |
429 | */ |
430 | private String getInfrastructureRequiredRole_3016Text(View view) { |
431 | IParser parser = PalladioComponentModelParserProvider |
432 | .getParser( |
433 | PalladioComponentModelElementTypes.InfrastructureRequiredRole_3016, |
434 | view.getElement() != null ? view.getElement() : view, |
435 | PalladioComponentModelVisualIDRegistry |
436 | .getType(InfrastructureRequiredRoleEntityNameEditPart.VISUAL_ID)); |
437 | if (parser != null) { |
438 | return parser.getPrintString(new EObjectAdapter( |
439 | view.getElement() != null ? view.getElement() : view), |
440 | ParserOptions.NONE.intValue()); |
441 | } else { |
442 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
443 | .getInstance().logError( |
444 | "Parser was not found for label " + 5018); //$NON-NLS-1$ |
445 | return ""; //$NON-NLS-1$ |
446 | } |
447 | } |
448 | |
449 | /** |
450 | * @generated |
451 | */ |
452 | private String getOperationProvidedRole_3011Text(View view) { |
453 | IParser parser = PalladioComponentModelParserProvider |
454 | .getParser( |
455 | PalladioComponentModelElementTypes.OperationProvidedRole_3011, |
456 | view.getElement() != null ? view.getElement() : view, |
457 | PalladioComponentModelVisualIDRegistry |
458 | .getType(OperationProvidedRoleEntityName2EditPart.VISUAL_ID)); |
459 | if (parser != null) { |
460 | return parser.getPrintString(new EObjectAdapter( |
461 | view.getElement() != null ? view.getElement() : view), |
462 | ParserOptions.NONE.intValue()); |
463 | } else { |
464 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
465 | .getInstance().logError( |
466 | "Parser was not found for label " + 5013); //$NON-NLS-1$ |
467 | return ""; //$NON-NLS-1$ |
468 | } |
469 | } |
470 | |
471 | /** |
472 | * @generated |
473 | */ |
474 | private String getOperationRequiredRole_3012Text(View view) { |
475 | IParser parser = PalladioComponentModelParserProvider |
476 | .getParser( |
477 | PalladioComponentModelElementTypes.OperationRequiredRole_3012, |
478 | view.getElement() != null ? view.getElement() : view, |
479 | PalladioComponentModelVisualIDRegistry |
480 | .getType(OperationRequiredRoleEntityName2EditPart.VISUAL_ID)); |
481 | if (parser != null) { |
482 | return parser.getPrintString(new EObjectAdapter( |
483 | view.getElement() != null ? view.getElement() : view), |
484 | ParserOptions.NONE.intValue()); |
485 | } else { |
486 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
487 | .getInstance().logError( |
488 | "Parser was not found for label " + 5014); //$NON-NLS-1$ |
489 | return ""; //$NON-NLS-1$ |
490 | } |
491 | } |
492 | |
493 | /** |
494 | * @generated |
495 | */ |
496 | private String getAssemblyConnector_4004Text(View view) { |
497 | AssemblyConnector domainModelElement = (AssemblyConnector) view |
498 | .getElement(); |
499 | if (domainModelElement != null) { |
500 | return domainModelElement.getId(); |
501 | } else { |
502 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
503 | .getInstance() |
504 | .logError( |
505 | "No domain element for view with visualID = " + 4004); //$NON-NLS-1$ |
506 | return ""; //$NON-NLS-1$ |
507 | } |
508 | } |
509 | |
510 | /** |
511 | * @generated |
512 | */ |
513 | private String getAssemblyEventConnector_4007Text(View view) { |
514 | AssemblyEventConnector domainModelElement = (AssemblyEventConnector) view |
515 | .getElement(); |
516 | if (domainModelElement != null) { |
517 | return domainModelElement.getId(); |
518 | } else { |
519 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
520 | .getInstance() |
521 | .logError( |
522 | "No domain element for view with visualID = " + 4007); //$NON-NLS-1$ |
523 | return ""; //$NON-NLS-1$ |
524 | } |
525 | } |
526 | |
527 | /** |
528 | * @generated |
529 | */ |
530 | private String getRequiredDelegationConnector_4005Text(View view) { |
531 | RequiredDelegationConnector domainModelElement = (RequiredDelegationConnector) view |
532 | .getElement(); |
533 | if (domainModelElement != null) { |
534 | return domainModelElement.getId(); |
535 | } else { |
536 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
537 | .getInstance() |
538 | .logError( |
539 | "No domain element for view with visualID = " + 4005); //$NON-NLS-1$ |
540 | return ""; //$NON-NLS-1$ |
541 | } |
542 | } |
543 | |
544 | /** |
545 | * @generated |
546 | */ |
547 | private String getProvidedDelegationConnector_4006Text(View view) { |
548 | ProvidedDelegationConnector domainModelElement = (ProvidedDelegationConnector) view |
549 | .getElement(); |
550 | if (domainModelElement != null) { |
551 | return domainModelElement.getId(); |
552 | } else { |
553 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
554 | .getInstance() |
555 | .logError( |
556 | "No domain element for view with visualID = " + 4006); //$NON-NLS-1$ |
557 | return ""; //$NON-NLS-1$ |
558 | } |
559 | } |
560 | |
561 | /** |
562 | * @generated |
563 | */ |
564 | private String getAssemblyInfrastructureConnector_4008Text(View view) { |
565 | AssemblyInfrastructureConnector domainModelElement = (AssemblyInfrastructureConnector) view |
566 | .getElement(); |
567 | if (domainModelElement != null) { |
568 | return domainModelElement.getId(); |
569 | } else { |
570 | PalladioComponentModelComposedStructureDiagramEditorPlugin |
571 | .getInstance() |
572 | .logError( |
573 | "No domain element for view with visualID = " + 4008); //$NON-NLS-1$ |
574 | return ""; //$NON-NLS-1$ |
575 | } |
576 | } |
577 | |
578 | /** |
579 | * @generated |
580 | */ |
581 | private String getUnknownElementText(View view) { |
582 | return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ |
583 | } |
584 | |
585 | /** |
586 | * @generated |
587 | */ |
588 | private String getUnresolvedDomainElementProxyText(View view) { |
589 | return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ |
590 | } |
591 | |
592 | /** |
593 | * @generated |
594 | */ |
595 | public void init(ICommonContentExtensionSite aConfig) { |
596 | } |
597 | |
598 | /** |
599 | * @generated |
600 | */ |
601 | public void restoreState(IMemento aMemento) { |
602 | } |
603 | |
604 | /** |
605 | * @generated |
606 | */ |
607 | public void saveState(IMemento aMemento) { |
608 | } |
609 | |
610 | /** |
611 | * @generated |
612 | */ |
613 | public String getDescription(Object anElement) { |
614 | return null; |
615 | } |
616 | |
617 | /** |
618 | * @generated |
619 | */ |
620 | private boolean isOwnView(View view) { |
621 | return ComposedProvidingRequiringEntityEditPart.MODEL_ID |
622 | .equals(PalladioComponentModelVisualIDRegistry.getModelID(view)); |
623 | } |
624 | |
625 | } |