Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2017-07-27 03:37:18 -0400
committervincent lorenzo2017-08-01 05:07:19 -0400
commita04a22bdde836439fd92ed3e13151bbfd34e9e0d (patch)
tree861e35551a60d3dd7e9c355ffb45847956919ee5
parentbb30ad4f8e8a27d005fd4775a539d836e2cb4084 (diff)
downloadorg.eclipse.papyrus-a04a22bdde836439fd92ed3e13151bbfd34e9e0d.tar.gz
org.eclipse.papyrus-a04a22bdde836439fd92ed3e13151bbfd34e9e0d.tar.xz
org.eclipse.papyrus-a04a22bdde836439fd92ed3e13151bbfd34e9e0d.zip
Bug 431940 - [CSS] Comment/Constraint links match rules defined for
UML::Connector https://bugs.eclipse.org/bugs/show_bug.cgi?id=431940 - Note AutoCompletion will be pushed in another commit(other modification in progress) Change-Id: Ided805b27e9d986e7e54fcc17df705af048eebd5 Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java5
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java50
2 files changed, 50 insertions, 5 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
index 58321119f24..11782bce56c 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
@@ -10,6 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus - bugs 461629, 436665
* Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - bug 462381
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - bug 431940
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.dom;
@@ -389,9 +390,9 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
localName = type;
}
} else if (getNotationElement() instanceof BasicCompartment) {
- return "Compartment";
+ localName = "Compartment";//$NON-NLS-1$
} else if (helper.isFloatingLabel(getNotationElement())) {
- return "Label";
+ localName = "Label";//$NON-NLS-1$
} else {
localName = getSemanticElement().eClass().getName();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
index 978210cd8bb..6a4de3f498f 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
@@ -10,7 +10,8 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 455311 : Refactor Stereotypes Display
* Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - bug 461489: add supports of AcceptEventAction
- * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 517679
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 431940
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.css.dom;
@@ -27,6 +28,7 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.DecorationNode;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.css.dom.GMFElementAdapter;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
@@ -84,6 +86,29 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
*/
private static final String TYPE_APPLIED_STEREOTYPES_PROPERTY = "typeAppliedStereotypes"; //$NON-NLS-1$
+ /** Notation type of comment link. */
+ private static final String COMMENT_ANNOTATED_ELEMENT_EDGE_TYPE = "Comment_AnnotatedElementEdge";//$NON-NLS-1$
+
+ /** Selector name for comment link. */
+ private static final String COMMENT_LINK = "CommentLink";//$NON-NLS-1$
+
+ /** Notation type of constraint link. */
+ private static final String CONSTRAINT_CONSTRAINED_ELEMENT_EDGE_TYPE = "Constraint_ConstrainedElementEdge";//$NON-NLS-1$
+
+ /** Selector name for constraint link. */
+ private static final String CONSTRAINT_LINK = "ConstraintLink";//$NON-NLS-1$
+
+ /** Notation type of context link. */
+ private static final String CONSTRAINT_CONTEXT_EDGE_TYPE = "Constraint_ContextEdge";//$NON-NLS-1$
+
+ /** Selector name for context link. */
+ private static final String CONTEXT_LINK = "ContextLink";//$NON-NLS-1$
+
+ /** Selector name for stereotype property reference link. */
+ private static final String STEREOTYPE_REFERENCE_LINK = "StereotypePropertyReferenceLink";//$NON-NLS-1$
+
+ /** Selector name for stereotype stereotype comment link. */
+ private static final String STEREOTYPE_COMMENT_LINK = "StereotypeCommentLink";//$NON-NLS-1$
/**
* The CSS Separator for qualifiers, when we must use CSS ID
@@ -362,9 +387,28 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
if (localName == null) {
// In case of StereotypeComment type, the selector should match on the Stereotype Comment.
if (stereotypeHelper.isStereotypeComment(getNotationElement())) {
- return STEREOTYPE_COMMENT;
+ localName = STEREOTYPE_COMMENT;
+ } else if (getSemanticElement() instanceof Edge) {
+ switch (((Edge) getSemanticElement()).getType()) {
+ case COMMENT_ANNOTATED_ELEMENT_EDGE_TYPE:
+ localName = COMMENT_LINK;
+ break;
+ case CONSTRAINT_CONSTRAINED_ELEMENT_EDGE_TYPE:
+ localName = CONSTRAINT_LINK;
+ break;
+ case CONSTRAINT_CONTEXT_EDGE_TYPE:
+ localName = CONTEXT_LINK;
+ break;
+ case STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT:
+ localName = STEREOTYPE_REFERENCE_LINK;
+ break;
+ case StereotypeDisplayConstant.STEREOTYPE_COMMENT_LINK_TYPE:
+ localName = STEREOTYPE_COMMENT_LINK;
+ break;
+ }
}
}
- return super.getLocalName();
+
+ return localName == null ? super.getLocalName() : localName;
}
}

Back to the top