Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2014-05-07 12:27:18 +0000
committerVincent Lorenzo2014-05-07 12:27:18 +0000
commitcb6d4ab4464a93406f22b1a8ca85a04b1538c18b (patch)
tree4fb9ac1c103f822bbe8a399c05610ecdf055136c
parent9bfcf83a7219d686767232cd9ae1a013c2aa5e98 (diff)
downloadorg.eclipse.papyrus-cb6d4ab4464a93406f22b1a8ca85a04b1538c18b.tar.gz
org.eclipse.papyrus-cb6d4ab4464a93406f22b1a8ca85a04b1538c18b.tar.xz
org.eclipse.papyrus-cb6d4ab4464a93406f22b1a8ca85a04b1538c18b.zip
421212: [Diagram] Papyrus should provide actions for Show/Hide related links in all diagrams
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java7
-rwxr-xr-xplugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policy/ShowHideRelatedLinkEditPolicy.java2
3 files changed, 10 insertions, 3 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
index 201a30528c6..98f18c15ea2 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
@@ -528,7 +528,7 @@ public abstract class AbstractShowHideRelatedLinkEditPolicy extends AbstractEdit
Set<View> targetViewList = domain2NotationMap.get(descriptor.getDestination());
for (View targetView : targetViewList) {
- if (canDisplayExistingLinkBetweenViews((Element) linkToShow, sourceView, targetView)){
+ if (canDisplayExistingLinkBetweenViews( linkToShow, sourceView, targetView)){
EditPart sourceEditPart = getEditPartFromView(sourceView);
EditPart targetEditPart = getEditPartFromView(targetView);
@@ -568,7 +568,7 @@ public abstract class AbstractShowHideRelatedLinkEditPolicy extends AbstractEdit
* @param targetView the target view
* @return true, if successful
*/
- public boolean canDisplayExistingLinkBetweenViews(final Element element, final View sourceView, final View targetView) {
+ public boolean canDisplayExistingLinkBetweenViews(final EObject element, final View sourceView, final View targetView) {
return true;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
index 1a1cabf3e11..c87ff5adbc2 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
@@ -23,6 +23,7 @@ import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.EdgeWithNoSemanticElementRepresentationImpl;
/**
@@ -51,6 +52,7 @@ public class Domain2Notation extends HashMap<EObject, Set<View>> {
for(View edge : sourceEdges) {
mapModel(edge);
}
+
}
@@ -62,6 +64,11 @@ public class Domain2Notation extends HashMap<EObject, Set<View>> {
*/
public void putView(View view) {
EObject element = view.getElement();
+ if(element == null) {
+ final EObject source = ((Connector)view).getSource().getElement();
+ final EObject target = ((Connector)view).getTarget().getElement();
+ element = new EdgeWithNoSemanticElementRepresentationImpl(source, target, view.getType());
+ }
Set<View> set = this.get(element);
if(set != null) {
set.add(view);
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policy/ShowHideRelatedLinkEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policy/ShowHideRelatedLinkEditPolicy.java
index 56beb25e126..43694152cc7 100755
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policy/ShowHideRelatedLinkEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policy/ShowHideRelatedLinkEditPolicy.java
@@ -343,7 +343,7 @@ public class ShowHideRelatedLinkEditPolicy extends AbstractUMLShowHideRelatedLin
*/
@Override
- public boolean canDisplayExistingLinkBetweenViews(final Element element, final View sourceView, final View targetView) {
+ public boolean canDisplayExistingLinkBetweenViews(final EObject element, final View sourceView, final View targetView) {
return (element instanceof Connector) && ConnectorUtils.canDisplayExistingConnectorBetweenViewsAccordingToNestedPaths((Connector) element, sourceView, targetView);
}

Back to the top