Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend106
1 files changed, 53 insertions, 53 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
index 4bf150c60d5..7a3a47a1c69 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
@@ -11,7 +11,7 @@
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
* Modified by Patrick Tessier (CEA LIST)
* Emilien Perico (Atos Origin) - update template for GMF 2.2 compliance
- */
+ */
package aspects.xpt.navigator
import aspects.xpt.Common
@@ -26,16 +26,16 @@ import xpt.Common_qvto
import xpt.editor.VisualIDRegistry
import xpt.navigator.Utils_qvto
-@Singleton class NavigatorContentProvider extends xpt.navigator.NavigatorContentProvider {
- @Inject extension Common;
- @Inject extension Common_qvto;
- @Inject extension Utils_qvto;
+@Singleton class NavigatorContentProvider extends xpt.navigator.NavigatorContentProvider {
+ @Inject extension Common;
+ @Inject extension Common_qvto;
+ @Inject extension Utils_qvto;
@Inject extension CodeStyle
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
-
- override NavigatorContentProvider(GenNavigator it) '''
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+
+ override NavigatorContentProvider(GenNavigator it) '''
«copyright(editorGen)»
package «packageName(it)»;
@@ -60,11 +60,11 @@ import xpt.navigator.Utils_qvto
«additions(it)»
}
- '''
-
-
-
- override processChanges(GenNavigator it) '''
+ '''
+
+
+
+ override processChanges(GenNavigator it) '''
for (java.util.Iterator<org.eclipse.emf.ecore.resource.Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
org.eclipse.emf.ecore.resource.Resource nextResource = it.next();
nextResource.unload();
@@ -73,8 +73,8 @@ import xpt.navigator.Utils_qvto
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
- '''
-
+ '''
+
override def initCommonAttributes(GenNavigator it) '''
org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = «createEditingDomain(it)»;
myEditingDomain = (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) editingDomain;
@@ -129,9 +129,9 @@ import xpt.navigator.Utils_qvto
public «className(it)»() {
«initCommonAttributes(it)»
}
- '''
-
- override dispose(GenNavigator it) '''
+ '''
+
+ override dispose(GenNavigator it) '''
«generatedMemberComment()»
public void dispose() {
myWorkspaceSynchronizer.dispose();
@@ -146,35 +146,35 @@ import xpt.navigator.Utils_qvto
((org.eclipse.emf.transaction.TransactionalEditingDomain) myEditingDomain).dispose();
myEditingDomain = null;
}
- '''
-
-
-
- override getFileChildren(GenNavigator it) '''
+ '''
+
+
+
+ override getFileChildren(GenNavigator it) '''
«var references = getChildReferencesFrom(it, null)»
«getFileResource(it)»
java.util.Collection<Object> result = new java.util.ArrayList<Object>();
- «FOR groupName : getGroupNames(references)»
+ «FOR groupName : getGroupNames(references)»
«initGroupVariables(groupName, it, references, 'file', null)»
- «ENDFOR»
+ «ENDFOR»
java.util.List<org.eclipse.gmf.runtime.notation.View> topViews = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>(resource.getContents().size());
for (org.eclipse.emf.ecore.EObject o : resource.getContents()) {
if (o instanceof org.eclipse.gmf.runtime.notation.View) {
topViews.add((org.eclipse.gmf.runtime.notation.View) o);
}
}
- «FOR ref : references»
+ «FOR ref : references»
«addNavigatorItemsPrefix(ref)»selectViewsByType(resource.getContents(), «getChildViewType(ref.child)»)«addNavigatorItemsSuffix(ref, 'file', false)»
- «ENDFOR»
- «FOR groupName : getGroupNames(references)»
+ «ENDFOR»
+ «FOR groupName : getGroupNames(references)»
«addGroups(groupName, references)»
- «ENDFOR»
+ «ENDFOR»
return result.toArray();
- '''
-
-
-
- override getViewChildren(GenNavigator it) '''
+ '''
+
+
+
+ override getViewChildren(GenNavigator it) '''
«generatedMemberComment()»
private Object[] getViewChildren(org.eclipse.gmf.runtime.notation.View view, Object parentElement) {
String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it.editorGen.diagram)»(view);
@@ -182,17 +182,17 @@ import xpt.navigator.Utils_qvto
switch (vid) {
««« BEGIN: PapyrusGenCode
««« Restructuration of the case
- «FOR node : getNavigatorContainerNodes(it)»
+ «FOR node : getNavigatorContainerNodes(it)»
«caseNavigatorNode(node, it)»
«ENDFOR»
- «««BEGIN: PapyrusGenCode
+ «««BEGIN: PapyrusGenCode
}
}
return EMPTY_ARRAY;
}
- '''
-
- override utilityMethods(GenNavigator it) '''
+ '''
+
+ override utilityMethods(GenNavigator it) '''
«IF getNavigatorContainerNodes(it).notEmpty»
«generatedMemberComment»
private java.util.Collection getLinksSourceByType(java.util.Collection edges, String type) {
@@ -288,10 +288,10 @@ import xpt.navigator.Utils_qvto
«getForeignShortcuts(it)»
- '''
-
- override getForeignShortcuts(GenNavigator it) '''
- «IF editorGen.diagram.generateCreateShortcutAction() && getChildReferencesFrom(it, editorGen.diagram).notEmpty»
+ '''
+
+ override getForeignShortcuts(GenNavigator it) '''
+ «IF editorGen.diagram.generateCreateShortcutAction() && getChildReferencesFrom(it, editorGen.diagram).notEmpty»
«generatedMemberComment()»
private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notation.Diagram diagram, Object parent) {
@@ -304,12 +304,12 @@ import xpt.navigator.Utils_qvto
}
return createNavigatorItems(result, parent, false);
}
- «ENDIF»
- '''
-
-
-
- override caseNavigatorNode(GenCommonBase it, GenNavigator navigator) '''
+ «ENDIF»
+ '''
+
+
+
+ override caseNavigatorNode(GenCommonBase it, GenNavigator navigator) '''
case «VisualIDRegistry::visualID(it)»: {
«««BEGIN: PapyrusGenCode
@@ -321,7 +321,7 @@ import xpt.navigator.Utils_qvto
'''
override createEditingDomain(GenNavigator it) '''org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain()'''
-
+
//BEGIN: PapyrusGenCode
//Loop to call generator of each method
def genAllMethodNodeCase(GenNavigator it)'''
@@ -387,5 +387,5 @@ override def String i18nKeyForGroup(String groupName, GenCommonBase contextEleme
CodeGenUtil::validJavaIdentifier(groupName)
}
-//END: PapyrusGenCod
-}
+//END: PapyrusGenCod
+}

Back to the top