diff options
author | Mickael ADAM | 2015-03-25 10:31:17 +0000 |
---|---|---|
committer | Camille Letavernier | 2015-04-08 15:39:07 +0000 |
commit | 96bb76a770c40ebd04e3f715e67f3bea1edccb80 (patch) | |
tree | 1b33600cb80ad2360901bcdda6ecf4fdcfae4051 /plugins/developer/org.eclipse.papyrus.def | |
parent | 6f2605795dd5ede4be959fa4871dcb0745ec8f9f (diff) | |
download | org.eclipse.papyrus-96bb76a770c40ebd04e3f715e67f3bea1edccb80.tar.gz org.eclipse.papyrus-96bb76a770c40ebd04e3f715e67f3bea1edccb80.tar.xz org.eclipse.papyrus-96bb76a770c40ebd04e3f715e67f3bea1edccb80.zip |
bug 462381 - [CSS] Floating label shall be selectable on CSS with the
attribute kind=FloatingLabel.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=462381
Patch Set 1:
-Add all floating label edit parts to notationTypeMap
-Modify GMFElementAdapter to take into account other type oof element
than compartment to use 'kind'
-Improve NotationTypeMap to permit to define a string list seperate
by commat to define the mapping between type and humanReadableType: ex:
7509, 1237,4666 <-> floatingLabel. This permit to have only one
mapping for several element which have the same humanReadableType
Patch Set 2:
-restore NotationTypeMap.java
-add NotationTypeMapping
-remove uml element from gmfgen index
-adds xtend generation for NotationTypeMapping
-Generate for diagram with Floating Label
-Adds missing LabelVisibilityPreference for composite diagram
Patch set 3:
-Rename notationTypeMap for Floating Label
-some fix on human read type
-add notationTypeMap for package to Bock definition diagram. This is
necessary else the compartment is not displayed
Patch set 4-5-6:
-rebase
Change-Id: I181c95adb639a69621582cc7c454d05891b2d152
Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
Reviewed-on: https://git.eclipse.org/r/44166
Tested-by: Hudson CI
Reviewed-by: Gabriel Pascual <gabriel.pascual@all4tec.net>
Reviewed-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend | 71 |
1 files changed, 68 insertions, 3 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend index ee2a39bf808..17ad3fd2a62 100644 --- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend +++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend @@ -12,6 +12,14 @@ import xpt.Common import xpt.editor.extensions
import xpt.plugin.pluginUtils
import org.eclipse.emf.ecore.EObject
+import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel
+import org.eclipse.gmf.codegen.gmfgen.GenCompartment
+import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode
@Singleton class plugin extends xpt.plugin.plugin { @@ -51,7 +59,8 @@ import org.eclipse.emf.ecore.EObject «extensionsConstraintProviders(it.editorGen)» «xptUpdaterExtension.extensions(it.editorGen.diagramUpdater)» «xptActionExtension.Main(it.editorGen)» - «additions(it)» + «additions(it)»
+ «notationTypesMap(editorGen)»
</plugin> ''' @@ -174,6 +183,62 @@ import org.eclipse.emf.ecore.EObject large_icon="«largeIconPath»" path="" small_icon="«smallIconPath»"> - </entry> - ''' + </entry> + '''
+
+ // set notation type mapping extension point
+ def notationTypesMap(GenEditorGenerator it) '''
+«tripleSpace(0)»<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
+«tripleSpace(1)»«xmlGeneratedTag»
+«tripleSpace(1)»<diagramMappings diagramID="«modelID»">
+«tripleSpace(1)» <mapping type="«modelID»" humanReadableType="«modelID.replaceAll('Papyrus|UML|Diagram', '')»Diagram"/>
+ «FOR compartment : diagram.compartments»
+ «compartmentToTypeMap(compartment)»
+ «ENDFOR»
+ «FOR link : diagram.links»
+ «linksToTypeMap(link)»
+ «ENDFOR»
+ «FOR floatingLabel : diagram.eResource.allContents.filter(typeof (GenExternalNodeLabel)).toIterable»
+ «nodesToTypeMap(floatingLabel)»
+ «ENDFOR»
+«tripleSpace(1)»</diagramMappings>
+«tripleSpace(0)»</extension>
+ '''
+ def compartmentToTypeMap(GenCompartment it) '''
+ <mapping
+ humanReadableType="«title.replaceAll('Compartment', '')»"
+ type="«visualID»">
+ </mapping>
+ '''
+
+ def linksToTypeMap(GenLink it) '''
+ «FOR label : labels»
+ «linkLabelToTypeMap(label)»
+ «ENDFOR»
+ '''
+
+ def linkLabelToTypeMap(GenLinkLabel it)'''
+ ««« it is used on a LabelVisibilityPreference...
+ «IF it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v | v.linkLabels.contains(it) && v.role != null].size != 0»
+ <mapping
+ humanReadableType="«it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v|v.linkLabels.contains(it)].head.role»"
+ type="«visualID»">
+ </mapping>
+ «ENDIF»
+ '''
+
+ def nodesToTypeMap(GenExternalNodeLabel it)'''
+ ««« it is used on a ExtensionGenView...
+ «IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v | v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
+ «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
+ «««...to be extended as floatingLabel
+ «IF "FloatingLabelEditPart".equals(extendedObject.name) »
+ <mapping
+ humanReadableType="Floating Label"
+ type="«visualID»">
+ </mapping>
+ «ENDIF»
+ «ENDFOR»
+ «ENDIF»
+ '''
} |