Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2018-05-18 11:43:45 -0400
committerLaurent Redor2018-05-18 11:43:45 -0400
commit5dee3b0b0f6094d11627d8d7ce6f0439a0572694 (patch)
tree78de29f5b1ae23b652e8de2f057c50b50c60f11d
parent84f1c5af0b8390d5ed231accd259b602333fa1b4 (diff)
downloadorg.eclipse.sirius-5dee3b0b0f6094d11627d8d7ce6f0439a0572694.tar.gz
org.eclipse.sirius-5dee3b0b0f6094d11627d8d7ce6f0439a0572694.tar.xz
org.eclipse.sirius-5dee3b0b0f6094d11627d8d7ce6f0439a0572694.zip
[527109] Fix a regression when POC is not enabledv5.1.2
Even if the POC is not enabled, there is a regression if someone contributes a DoubleClickAction. Bug: 527109 Change-Id: Ic8577e685672030cdeb3574b31ed90510147c302 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java
index bff3fbde04..5a77a4b35c 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/DoubleClickEditPolicyProvider.java
@@ -21,7 +21,9 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.DDiagramElement;
+import org.eclipse.sirius.diagram.description.DiagramElementMapping;
import org.eclipse.sirius.diagram.ui.edit.api.part.IAbstractDiagramNodeEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramEdgeEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramNameEditPart;
@@ -58,6 +60,7 @@ public class DoubleClickEditPolicyProvider implements IEditPolicyProvider {
@Override
public boolean provides(IOperation operation) {
+ boolean result = false;
if (operation instanceof CreateEditPoliciesOperation) {
CreateEditPoliciesOperation castedOperation = (CreateEditPoliciesOperation) operation;
EditPart editPart = castedOperation.getEditPart();
@@ -65,11 +68,18 @@ public class DoubleClickEditPolicyProvider implements IEditPolicyProvider {
if (model instanceof View) {
EObject element = ((View) model).getElement();
if (element instanceof DDiagramElement) {
- return true;
+ DDiagramElement dDiagramElement = (DDiagramElement) element;
+ DDiagram parentDiagram = dDiagramElement.getParentDiagram();
+ if (parentDiagram.isIsInShowingMode()) {
+ result = true;
+ } else {
+ DiagramElementMapping diagramElementMapping = dDiagramElement.getDiagramElementMapping();
+ result = diagramElementMapping.getDoubleClickDescription() != null;
+ }
}
}
}
- return false;
+ return result;
}
@Override

Back to the top