Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2014-02-25 16:35:22 +0000
committerFlorian Noyrit2014-02-25 16:35:22 +0000
commite6640915c57d431d04bd85d42bf6da5fa4434dda (patch)
tree9586daedc65fe839ea1b4578d814abc3162019a0 /plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend
parent8d18c0394e06cd1a311b5e497d80a92b9c9e840b (diff)
downloadorg.eclipse.papyrus-e6640915c57d431d04bd85d42bf6da5fa4434dda.tar.gz
org.eclipse.papyrus-e6640915c57d431d04bd85d42bf6da5fa4434dda.tar.xz
org.eclipse.papyrus-e6640915c57d431d04bd85d42bf6da5fa4434dda.zip
Update of generation templates from XPAND to XTEND
Update Papyrus Xtend custom generation templates to remove preferences. Updates UI of preferences pages.
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend70
1 files changed, 70 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend
new file mode 100644
index 00000000000..ac77dd6ebdd
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ExternalNodeLabelEditPart.xtend
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2006, 2009, 2013 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
+ * Alexander Shatalin (Borland) - initial API and implementation
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference
+import xpt.Common
+
+@Singleton class ExternalNodeLabelEditPart extends diagram.editparts.ExternalNodeLabelEditPart {
+ @Inject extension Common;
+
+ override extendsList(GenExternalNodeLabel it) '''
+ «««BEGIN: PapyrusGenCode
+ «««specify a java super class for external nodes
+ «IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v | v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
+ extends «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
+ «specifyInheritance(extendedObject as ExtendedGenView)»
+ «ENDFOR»
+ «««END: PapyrusGenCode
+ «ELSE»
+ extends org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart
+ «ENDIF»
+ '''
+
+ //we add the interface ILabelRoleProvider
+ override implementsList(GenExternalNodeLabel it) '''
+ implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart
+ ««« BEGIN: PapyrusGenCode
+ «IF it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v|v.externalNodeLabels.contains(it)].size != 0»
+ , org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider
+ «ENDIF»
+ ««« END: PapyrusGenCode
+ '''
+
+ override additions(GenExternalNodeLabel it) '''
+ ««« BEGIN: PapyrusGenCode
+ «IF it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v|v.externalNodeLabels.contains(it)].size != 0»
+ «generatedClassComment»
+ public String getLabelRole(){
+ return "«it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v|v.externalNodeLabels.contains(it)].head.role»";//$NON-NLS-1$
+ }
+
+ «generatedClassComment»
+ public String getIconPathRole(){
+ return "«it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v|v.externalNodeLabels.contains(it)].head.iconPathRole»";//$NON-NLS-1$
+ }
+ «ENDIF»
+ ««« END: PapyrusGenCode
+ '''
+
+ //BEGIN: PapyrusGenCode
+ //definition of the inheritance
+ def specifyInheritance(ExtendedGenView it) '''«superOwnedEditPart»'''
+
+//END: PapyrusGenCode
+}

Back to the top