Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9e8a050703ee76c2e035e223ec39606709cfb0ca (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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
/*
 * Copyright (c) 2006,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:
 *    Alexander Shatalin (Borland) - initial API and implementation
 */
 
«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
«EXTENSION xpt::navigator::Utils»
«EXTENSION org::eclipse::gmf::internal::codegen::util::CodeGenerationUtils»

«DEFINE NavigatorContentProvider FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::copyright FOR editorGen-»
package «packageName»;

«EXPAND xpt::Common::generatedClassComment»
public class «contentProviderClassName» implements org.eclipse.ui.navigator.ICommonContentProvider {

	«EXPAND attributes-»
	
	«EXPAND _constructor-»

	«EXPAND iContentProvider-»
	
	«EXPAND iStructuredContentProvider-»
	
	«EXPAND iMementoAware-»
    
    «EXPAND iCommonContentProvider-»
    
    «EXPAND iTreeContentProvider-»
    
    «EXPAND additions-»
}
«ENDDEFINE»

«DEFINE attributes FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
private static final Object[] EMPTY_ARRAY = new Object[0];

	«EXPAND xpt::Common::generatedMemberComment»
private org.eclipse.jface.viewers.Viewer myViewer;

	«EXPAND xpt::Common::generatedMemberComment»
private org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain myEditingDomain;

	«EXPAND xpt::Common::generatedMemberComment»
private org.eclipse.emf.workspace.util.WorkspaceSynchronizer myWorkspaceSynchronizer;

	«EXPAND xpt::Common::generatedMemberComment»
private Runnable myViewerRefreshRunnable;
«ENDDEFINE»

«DEFINE _constructor FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
public «contentProviderClassName»() {
	«EXPAND initCommonAttributes-»
}
«ENDDEFINE»

«DEFINE initCommonAttributes FOR gmfgen::GenNavigator-»
org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = «EXPAND createEditingDomain»;
myEditingDomain = (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) editingDomain;
myEditingDomain.setResourceToReadOnlyMap(new java.util.HashMap() {
	public Object get(Object key) {
		if (!containsKey(key)) {
			put(key, Boolean.TRUE);
		}
		return super.get(key);
	}
});
myViewerRefreshRunnable = new Runnable() {
	public void run() {
		if (myViewer != null) {
			myViewer.refresh();
		}
	}
};
myWorkspaceSynchronizer = new org.eclipse.emf.workspace.util.WorkspaceSynchronizer(editingDomain, new org.eclipse.emf.workspace.util.WorkspaceSynchronizer.Delegate() {
	public void dispose() {
	}

	public boolean handleResourceChanged(final org.eclipse.emf.ecore.resource.Resource resource) {
		«EXPAND processChanges-»
	}
	
	public boolean handleResourceDeleted(org.eclipse.emf.ecore.resource.Resource resource) {
		«EXPAND processChanges-»
	}
	
	public boolean handleResourceMoved(org.eclipse.emf.ecore.resource.Resource resource, final org.eclipse.emf.common.util.URI newURI) {
		«EXPAND processChanges-»
	}
});
«ENDDEFINE»

«DEFINE processChanges FOR gmfgen::GenNavigator-»
for (java.util.Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
	org.eclipse.emf.ecore.resource.Resource nextResource = (org.eclipse.emf.ecore.resource.Resource) it.next();
	nextResource.unload();
}
if (myViewer != null) {
	myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
«ENDDEFINE»

«DEFINE iContentProvider FOR gmfgen::GenNavigator-»
	«EXPAND dispose-»
	
	«EXPAND inputChanged-»
«ENDDEFINE»

«DEFINE dispose FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
public void dispose() {
	myWorkspaceSynchronizer.dispose();
	myWorkspaceSynchronizer = null;
	myViewerRefreshRunnable = null;
	for (java.util.Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
		org.eclipse.emf.ecore.resource.Resource resource = (org.eclipse.emf.ecore.resource.Resource) it.next();
		resource.unload();
	}
	((org.eclipse.emf.transaction.TransactionalEditingDomain) myEditingDomain).dispose();
	myEditingDomain = null;
}
«ENDDEFINE»

«DEFINE inputChanged FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
public void inputChanged(org.eclipse.jface.viewers.Viewer viewer, Object oldInput, Object newInput) {
	myViewer = viewer;
}
«ENDDEFINE»

«DEFINE iStructuredContentProvider FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public Object[] getElements(Object inputElement) {
	return getChildren(inputElement);
}
«ENDDEFINE»

«DEFINE iMementoAware FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public void restoreState(org.eclipse.ui.IMemento aMemento) {
}

«EXPAND xpt::Common::generatedMemberComment»
public void saveState(org.eclipse.ui.IMemento aMemento) {
}
«ENDDEFINE»

«DEFINE iCommonContentProvider FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public void init(org.eclipse.ui.navigator.ICommonContentExtensionSite aConfig) {
}
«ENDDEFINE»

«DEFINE iTreeContentProvider FOR gmfgen::GenNavigator-»
	«EXPAND getChildren-»
	
	«EXPAND getParent-»
	
	«EXPAND hasChildren-»
«ENDDEFINE»

«DEFINE getChildren FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public Object[] getChildren(Object parentElement) {
	if (parentElement instanceof org.eclipse.core.resources.IFile) {
	«EXPAND getFileChildren-»
   	} 
    	
   	if (parentElement instanceof «getNavigatorGroupQualifiedClassName()») {
	«EXPAND getGroupChildren-»
	} 
		
	if (parentElement instanceof «getNavigatorItemQualifiedClassName()») {
	«EXPAND getItemChildren-»
	}
		
	«IF editorGen.diagram.generateShortcutIcon()-»
		«EXPAND getAdaptableChildren»
	«ENDIF-»
	«EXPAND getOtherChildren-»
}
    
	«EXPAND getViewChildren-»
    
    «EXPAND utilityMethods-»
«ENDDEFINE»

«DEFINE getParent FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public Object getParent(Object element) {
	if (element instanceof «getAbstractNavigatorItemQualifiedClassName()») {
    	«getAbstractNavigatorItemQualifiedClassName()» abstractNavigatorItem = («getAbstractNavigatorItemQualifiedClassName()») element;
		return abstractNavigatorItem.getParent();
	}
	return null;
}
«ENDDEFINE»

«DEFINE hasChildren FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
public boolean hasChildren(Object element) {
	return element instanceof org.eclipse.core.resources.IFile || getChildren(element).length > 0;
}
«ENDDEFINE»

«DEFINE getFileChildren FOR gmfgen::GenNavigator-»
	«EXPAND getFileResoruce-»
java.util.Collection result = new java.util.ArrayList();
	«LET getChildReferencesFrom(self, null) AS _references-»
		«EXPAND initGroupVariables(self, _references, 'file', null) FOREACH getGroupNames(_references)-»
		«FOREACH _references AS ref-»
			«EXPAND addNavigatorItemsPrefix FOR ref»selectViewsByType(resource.getContents(), «EXPAND getChildViewType FOR ref.child»)«EXPAND addNavigatorItemsSuffix('file', false) FOR ref-»
		«ENDFOREACH-»
		«EXPAND addGroups(_references) FOREACH getGroupNames(_references)-»
	«ENDLET-»
return result.toArray();
«ENDDEFINE»

«DEFINE getFileResoruce FOR gmfgen::GenNavigator-»
org.eclipse.core.resources.IFile file = (org.eclipse.core.resources.IFile) parentElement;
org.eclipse.emf.common.util.URI fileURI = org.eclipse.emf.common.util.URI.createPlatformResourceURI(file.getFullPath().toString(), true);
org.eclipse.emf.ecore.resource.Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
«ENDDEFINE»

«DEFINE getGroupChildren FOR gmfgen::GenNavigator-»
«getNavigatorGroupQualifiedClassName()» group = («getNavigatorGroupQualifiedClassName()») parentElement;
return group.getChildren();
«ENDDEFINE»

«DEFINE getItemChildren FOR gmfgen::GenNavigator-»
«getNavigatorItemQualifiedClassName()» navigatorItem = («getNavigatorItemQualifiedClassName()») parentElement;
if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
	return EMPTY_ARRAY;
}
return getViewChildren(navigatorItem.getView(), parentElement);
«ENDDEFINE»

«DEFINE getAdaptableChildren FOR gmfgen::GenNavigator-»
/*
 * Due to plugin.xml restrictions this code will be called only for views representing
 * shortcuts to this diagram elements created on other diagrams. 
*/ 
if (parentElement instanceof org.eclipse.core.runtime.IAdaptable) {
	org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) ((org.eclipse.core.runtime.IAdaptable) parentElement).getAdapter(org.eclipse.gmf.runtime.notation.View.class);
	if (view != null) {
		return getViewChildren(view, parentElement);
	}
}
«ENDDEFINE»

«DEFINE getOtherChildren FOR gmfgen::GenNavigator-»
return EMPTY_ARRAY;
«ENDDEFINE»

«DEFINE getViewChildren FOR gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
private Object[] getViewChildren(org.eclipse.gmf.runtime.notation.View view, Object parentElement) {
   	switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR editorGen.diagram»(view)) {
	«EXPAND caseNavigatorNode(self) FOREACH getNavigatorContainerNodes(self)-»
	}
	return EMPTY_ARRAY;
}
«ENDDEFINE»

«DEFINE utilityMethods FOR  gmfgen::GenNavigator-»
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection getLinksSourceByType(java.util.Collection edges, String type) {
	java.util.Collection result = new java.util.ArrayList();
 	for (java.util.Iterator it = edges.iterator(); it.hasNext();) {
 		org.eclipse.gmf.runtime.notation.Edge nextEdge = (org.eclipse.gmf.runtime.notation.Edge) it.next();
 		org.eclipse.gmf.runtime.notation.View nextEdgeSource = nextEdge.getSource();
 		if (type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
 			result.add(nextEdgeSource);
 		}
 	}
 	return result;
}
	
«EXPAND xpt::Common::generatedMemberComment»
 private java.util.Collection getLinksTargetByType(java.util.Collection edges, String type) {
	java.util.Collection result = new java.util.ArrayList();
 	for (java.util.Iterator it = edges.iterator(); it.hasNext();) {
 		org.eclipse.gmf.runtime.notation.Edge nextEdge = (org.eclipse.gmf.runtime.notation.Edge) it.next();
 		org.eclipse.gmf.runtime.notation.View nextEdgeTarget = nextEdge.getTarget();
 		if (type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
 			result.add(nextEdgeTarget);
 		}
 	}
 	return result;
}

«EXPAND xpt::Common::generatedMemberComment»
 private java.util.Collection getOutgoingLinksByType(java.util.Collection nodes, String type) {
	java.util.Collection result = new java.util.ArrayList();
 	for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
 		org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
		result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
 	}
 	return result;
}
	
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection getIncomingLinksByType(java.util.Collection nodes, String type) {
	java.util.Collection result = new java.util.ArrayList();
 	for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
 		org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
		result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
 	}
 	return result;
}
	
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection getChildrenByType(java.util.Collection nodes, String type) {
	java.util.Collection result = new java.util.ArrayList();
	for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
		org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
		result.addAll(selectViewsByType(nextNode.getChildren(), type));
	}
	return result;
}
	
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection getDiagramLinksByType(java.util.Collection diagrams, String type) {
	java.util.Collection result = new java.util.ArrayList();
	for (java.util.Iterator it = diagrams.iterator(); it.hasNext();) {
		org.eclipse.gmf.runtime.notation.Diagram nextDiagram = (org.eclipse.gmf.runtime.notation.Diagram) it.next();
		result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
	}
	return result;
}

«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection selectViewsByType(java.util.Collection views, String type) {
	java.util.Collection result = new java.util.ArrayList();
	for (java.util.Iterator it = views.iterator(); it.hasNext();) {
		org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
		if (type.equals(nextView.getType()) && isOwnView(nextView)) {
			result.add(nextView);
		}
	}
	return result;
}
	
«EXPAND xpt::Common::generatedMemberComment»
private boolean isOwnView(org.eclipse.gmf.runtime.notation.View view) {
	return «EXPAND xpt::editor::VisualIDRegistry::modelID FOR editorGen.diagram».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall FOR editorGen.diagram»(view));
}
	
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection createNavigatorItems(java.util.Collection views, Object parent, boolean isLeafs) {
	java.util.Collection result = new java.util.ArrayList();
	for (java.util.Iterator it = views.iterator(); it.hasNext();) {
		result.add(new «getNavigatorItemQualifiedClassName()»((org.eclipse.gmf.runtime.notation.View) it.next(), parent, isLeafs));
	}
	return result;
}
«EXPAND getForeignShortcuts-»
«ENDDEFINE»

«DEFINE getForeignShortcuts FOR gmfgen::GenNavigator-»
	«IF editorGen.diagram.generateCreateShortcutAction() and getChildReferencesFrom(self, editorGen.diagram)->size() > 0-»
	
«EXPAND xpt::Common::generatedMemberComment»
private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notation.Diagram diagram, Object parent) {
	java.util.Collection result = new java.util.ArrayList();
	for (java.util.Iterator it = diagram.getChildren().iterator(); it.hasNext();) {
		org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
		if (!isOwnView(nextView) && nextView.getEAnnotation("Shortcut") != null) { «EXPAND xpt::Common::nonNLS»
			result.add(nextView);
		}
	}
	return createNavigatorItems(result, parent, false);
}
	«ENDIF-»
«ENDDEFINE»

«DEFINE createEditingDomain FOR gmfgen::GenNavigator»org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory.INSTANCE.createEditingDomain()«ENDDEFINE»

«DEFINE initGroupVariables(navigator : gmfgen::GenNavigator, _references : Sequence(gmfgen::GenNavigatorChildReference), parentVarName : String, contextElement : gmfgen::GenCommonBase) FOR String-»
	«navigator.getNavigatorGroupQualifiedClassName()» «validJavaIdentifier(self)» = new «navigator.getNavigatorGroupQualifiedClassName()»(
	«EXPAND xpt::Externalizer::accessorCall(i18nKeyForGroup(self, contextElement)) FOR navigator.editorGen»,
	"«getNavigatorReference(self, _references).groupIcon»", «parentVarName»); «EXPAND xpt::Common::nonNLS»
«ENDDEFINE»

«DEFINE addNavigatorItemsPrefix FOR gmfgen::GenNavigatorChildReference»«IF isInsideGroup()»«validJavaIdentifier(groupName)».addChildren(«ELSE»result.addAll(«ENDIF»createNavigatorItems(«ENDDEFINE»

«DEFINE addNavigatorItemsSuffix(parentVarName : String, isLeaf : Boolean) FOR gmfgen::GenNavigatorChildReference-»
, «IF isInsideGroup()»«validJavaIdentifier(groupName)»«ELSE»«parentVarName»«ENDIF», «isLeaf»));
«ENDDEFINE»

«DEFINE addGroups(_references : Sequence(gmfgen::GenNavigatorChildReference)) FOR String-»
	«LET getNavigatorReference(self, _references) AS ref-»
		«IF ref.hideIfEmpty-»
			if (!«validJavaIdentifier(self)».isEmpty()) {«ENDIF-»
		result.add(«validJavaIdentifier(self)»);
		«IF ref.hideIfEmpty-»
			}«ENDIF-»
	«ENDLET-»
«ENDDEFINE»

«DEFINE getChildViewType FOR gmfgen::GenDiagram»«EXPAND xpt::editor::VisualIDRegistry::modelID»«ENDDEFINE»

«DEFINE getChildViewType FOR gmfgen::GenCommonBase»«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»«ENDDEFINE»

«DEFINE caseNavigatorNode(navigator : gmfgen::GenNavigator) FOR gmfgen::GenCommonBase»
«EXPAND xpt::Common::caseVisualID» {
	java.util.Collection result = new java.util.ArrayList();
	«EXPAND addForeignShortcuts FOR self-»
	«LET getChildReferencesFrom(navigator, self) AS _references-»
		«EXPAND initGroupVariables(navigator, _references, 'parentElement', self) FOREACH getGroupNames(_references)-»
		«FOREACH _references AS reference ITERATOR referencesIterator-»
			«FOREACH reference.findConnectionPaths()->asSequence() AS path ITERATOR pathsIterator-»
				«FOREACH path.segments->asSequence() AS segment ITERATOR segmentsIterator-»
					«IF referencesIterator.isFirstIteration() and (pathsIterator.isFirstIteration() and segmentsIterator.isFirstIteration())»java.util.Collection «ENDIF-»
					connectedViews = «EXPAND childrenMethodName(reference.referenceType, segment) FOR segment._from-»
					(«IF segmentsIterator.isFirstIteration()»java.util.Collections.singleton(view)«ELSE»connectedViews«ENDIF-»
					, «EXPAND xpt::editor::VisualIDRegistry::typeMethodCall FOR segment.to»);
				«ENDFOREACH-»
				«EXPAND addNavigatorItemsPrefix FOR reference»connectedViews«EXPAND addNavigatorItemsSuffix('parentElement', reference.referenceType <> gmfgen::GenNavigatorReferenceType::children) FOR reference-»
			«ENDFOREACH-»
		«ENDFOREACH-»
		«EXPAND addGroups(_references) FOREACH getGroupNames(_references)-»
	«ENDLET-»
	return result.toArray();
}
«ENDDEFINE»

«DEFINE addForeignShortcuts FOR gmfgen::GenDiagram-»
	«IF generateCreateShortcutAction()-»
result.addAll(getForeignShortcuts((org.eclipse.gmf.runtime.notation.Diagram) view, parentElement));
	«ENDIF-»
«ENDDEFINE»

«DEFINE addForeignShortcuts FOR gmfgen::GenCommonBase»«ENDDEFINE»

«DEFINE childrenMethodName(referenceType : gmfgen::GenNavigatorReferenceType, segment : gmfgen::GenNavigatorPathSegment) FOR gmfgen::GenLink-»
	«IF referenceType = gmfgen::GenNavigatorReferenceType::out_target»getLinksTargetByType«ELSE»getLinksSourceByType«ENDIF-»
«ENDDEFINE»

«DEFINE childrenMethodName(referenceType : gmfgen::GenNavigatorReferenceType, segment : gmfgen::GenNavigatorPathSegment) FOR gmfgen::GenCommonBase-»
	«IF referenceType = gmfgen::GenNavigatorReferenceType::out_target-»
		getOutgoingLinksByType«ELSEIF referenceType = gmfgen::GenNavigatorReferenceType::in_source-»
		getIncomingLinksByType«ELSE-»
		«IF (Sequence { segment._from })[gmfgen::GenDiagram]->size() > 0 and (Sequence { segment.to })[gmfgen::GenLink]->size() > 0-»
			getDiagramLinksByType«ELSE-»
			getChildrenByType«ENDIF-»
	«ENDIF-»
«ENDDEFINE»

«DEFINE additions FOR gmfgen::GenNavigator-»
«ENDDEFINE»

«DEFINE i18nAccessors FOR gmfgen::GenNavigator-»
	«LET getChildReferencesFrom(self, null) AS _references-»
        «EXPAND internal_i18nAccessors(null) FOREACH getGroupNames(_references)-»
	«ENDLET-»
	«FOREACH getNavigatorContainerNodes(self) AS contextElement-»
        «LET getChildReferencesFrom(self, contextElement) AS _references-»
            «EXPAND internal_i18nAccessors(contextElement) FOREACH getGroupNames(_references)-»
        «ENDLET-»
	«ENDFOREACH-»
«ENDDEFINE»

«DEFINE internal_i18nAccessors(contextElement : gmfgen::GenCommonBase) FOR String-»
«IF null <> self»«EXPAND xpt::Externalizer::accessorField(i18nKeyForGroup(self, contextElement))»«ENDIF-»
«ENDDEFINE»

«DEFINE i18nValues FOR gmfgen::GenNavigator-»
«LET getChildReferencesFrom(self, null) AS _references-»
«EXPAND internal_i18nValues(null) FOREACH getGroupNames(_references)-»
«ENDLET-»
«FOREACH getNavigatorContainerNodes(self) AS contextElement-»
«LET getChildReferencesFrom(self, contextElement) AS _references-»
«EXPAND internal_i18nValues(contextElement) FOREACH getGroupNames(_references)-»
«ENDLET-»
«ENDFOREACH-»
«ENDDEFINE»

«DEFINE internal_i18nValues(contextElement : gmfgen::GenCommonBase) FOR String-»
«IF null <> self»«EXPAND xpt::Externalizer::messageEntry(i18nKeyForGroup(self, contextElement), self)»«ENDIF-»
«ENDDEFINE»

Back to the top