Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Guilet2018-09-26 15:56:04 +0000
committerPierre Guilet2018-09-27 07:55:39 +0000
commitee17eaffb672a7f85ad90dc5e0a4fbe9a0a3c32f (patch)
tree05ba5eeb35be39eabc5842926f9bdef73c57170d
parent69b590cadabd76dd0a71a81ed4ab03fab11bd90a (diff)
downloadorg.eclipse.sirius-ee17eaffb672a7f85ad90dc5e0a4fbe9a0a3c32f.tar.gz
org.eclipse.sirius-ee17eaffb672a7f85ad90dc5e0a4fbe9a0a3c32f.tar.xz
org.eclipse.sirius-ee17eaffb672a7f85ad90dc5e0a4fbe9a0a3c32f.zip
[527109] Disable the tabbar hide action for invisible element
Hide action is now disabled when the selected element is invisible in visibility mode. Bug: 527109 Change-Id: I49a543e6fe86389d7e7ebfdbec9c5b28e5e03301 Signed-off-by: Pierre Guilet <pierre.guilet@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/HideDDiagramElementAction.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/HideDDiagramElementAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/HideDDiagramElementAction.java
index 6fc60d8815..7c9960907d 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/HideDDiagramElementAction.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/HideDDiagramElementAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES and others.
* 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
@@ -57,8 +57,7 @@ import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
/**
- * Hide a {@link DDiagramElement} on a
- * {@link org.eclipse.sirius.diagram.DDiagram}.
+ * Hide a {@link DDiagramElement} on a {@link org.eclipse.sirius.diagram.DDiagram}.
*
* @author cbrun
*
@@ -150,8 +149,9 @@ public class HideDDiagramElementAction extends Action implements IObjectActionDe
}
if (!ddes.isEmpty()) {
- Predicate<DDiagramElement> allowsHideReveal = allowsHideReveal(ddes.iterator().next().getParentDiagram());
- return Iterables.all(ddes, allowsHideReveal);
+ DDiagram parentDiagram = ddes.iterator().next().getParentDiagram();
+ Predicate<DDiagramElement> allowsHideReveal = allowsHideReveal(parentDiagram);
+ return Iterables.all(ddes, allowsHideReveal) && !parentDiagram.isIsInShowingMode();
}
}
@@ -275,8 +275,7 @@ public class HideDDiagramElementAction extends Action implements IObjectActionDe
*
* @param diagram
* the diagram to inspect
- * @return true if the given ddiagram is allowing layouting mode, false
- * otherwise
+ * @return true if the given ddiagram is allowing layouting mode, false otherwise
*/
public static Predicate<DDiagramElement> allowsHideReveal(DDiagram diagram) {
// default return value is true for non-Region element (for basic

Back to the top