Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2014-05-07 11:27:56 +0000
committerVincent Lorenzo2014-05-07 11:31:37 +0000
commit6942da7d8d3f8fbce2736ea061353eb2a80f61a5 (patch)
tree174998189456bab9e13da07cf3dbf4a633644023
parent12b28e955da4b640d856c14504e9be02db52ce43 (diff)
downloadorg.eclipse.papyrus-6942da7d8d3f8fbce2736ea061353eb2a80f61a5.tar.gz
org.eclipse.papyrus-6942da7d8d3f8fbce2736ea061353eb2a80f61a5.tar.xz
org.eclipse.papyrus-6942da7d8d3f8fbce2736ea061353eb2a80f61a5.zip
421212: [Diagram] Papyrus should provide actions for Show/Hide related links in all diagrams Add ShowHideRelatedLinkEditPolicy to ModelEditPart
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ShowHideRelatedLinkEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java10
4 files changed, 77 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ShowHideRelatedLinkEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ShowHideRelatedLinkEditPolicy.java
new file mode 100644
index 00000000000..e03e7743302
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/ShowHideRelatedLinkEditPolicy.java
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.clazz.custom.policies;
+
+import org.eclipse.gmf.tooling.runtime.structure.DiagramStructure;
+import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;
+import org.eclipse.papyrus.uml.diagram.clazz.custom.edit.part.CustomUMLDiagramUpdater;
+import org.eclipse.papyrus.uml.diagram.clazz.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractUMLShowHideRelatedLinkEditPolicy;
+
+/**
+ * Show Hide link editpolicy for Class Diagram
+ *
+ *
+ */
+public class ShowHideRelatedLinkEditPolicy extends AbstractUMLShowHideRelatedLinkEditPolicy {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param host
+ */
+ public ShowHideRelatedLinkEditPolicy() {
+ super();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DiagramUpdater getDiagramUpdater() {
+ return CustomUMLDiagramUpdater.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IDiagramInformationProviderEditPolicy#getDiagramStructure()
+ *
+ * @return
+ */
+
+ @Override
+ public DiagramStructure getDiagramStructure() {
+ return UMLVisualIDRegistry.TYPED_INSTANCE;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen
index e2691e4f2f3..c6b3db08135 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen
@@ -37,6 +37,10 @@
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.clazz.custom.policies.ClassDiagramDragDropEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.AbstractShowHideRelatedLinkEditPolicy.SHOW_HIDE_RELATED_LINK_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.clazz.custom.policies.ShowHideRelatedLinkEditPolicy"/>
<domainDiagramElement
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
<childNodes
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java
index a2579c6d785..f6377ab6b89 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java
@@ -14,8 +14,10 @@ package org.eclipse.papyrus.uml.diagram.clazz.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.AbstractShowHideRelatedLinkEditPolicy;
import org.eclipse.papyrus.uml.diagram.clazz.custom.policies.ClassDiagramDragDropEditPolicy;
import org.eclipse.papyrus.uml.diagram.clazz.custom.policies.RemoveOrphanViewPolicy;
+import org.eclipse.papyrus.uml.diagram.clazz.custom.policies.ShowHideRelatedLinkEditPolicy;
import org.eclipse.papyrus.uml.diagram.clazz.edit.policies.ModelItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
@@ -54,6 +56,7 @@ public class ModelEditPart extends PapyrusDiagramEditPart {
//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.clazz.edit.policies.ModelCanonicalEditPolicy());
installEditPolicy("RemoveOrphanView", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new ClassDiagramDragDropEditPolicy());
+ installEditPolicy(AbstractShowHideRelatedLinkEditPolicy.SHOW_HIDE_RELATED_LINK_ROLE, new ShowHideRelatedLinkEditPolicy());
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
index 3cc7b3b8870..1d13f504a4f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
@@ -72,6 +72,16 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
public AbstractUMLShowHideRelatedLinkEditPolicy(final DiagramEditPart host) {
super(host);
}
+
+ /**
+ *
+ * Constructor.
+ *
+ *
+ */
+ public AbstractUMLShowHideRelatedLinkEditPolicy() {
+ super(null);
+ }
/**

Back to the top