Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2019-08-30 10:49:46 -0400
committerPatrick Tessier2019-09-18 03:54:48 -0400
commit2ec299164d14b33e605d71058237016125e0ee72 (patch)
tree23cfac79363c2851169cb13da40d6e68a5b64558 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse
parent8fd2a0edd4ab3a6b26bf4c87cecf0ef6cf9e9e7e (diff)
downloadorg.eclipse.papyrus-2ec299164d14b33e605d71058237016125e0ee72.tar.gz
org.eclipse.papyrus-2ec299164d14b33e605d71058237016125e0ee72.tar.xz
org.eclipse.papyrus-2ec299164d14b33e605d71058237016125e0ee72.zip
Bug 550568: [AF] The diagrams and tables icons of disabled viewpoint
should be grayed - Add grayed icon into the architecture framework - Create the grayed icons for diagrams and tables - Manage the view prototype display in: - Model Explorer - Welcome page - Table of views - Properties views Change-Id: I3301e9d17cb12c5ca59f2175b5cb0b86e6733917 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse')
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java48
2 files changed, 46 insertions, 7 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
index b93b36dc903..a63b3c59b4e 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2017 CEA LIST and others.
+ * Copyright (c) 2013, 2017, 2019 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
* Christian W. Damus - bug 527580
* Ansgar Radermacher - bug 539754
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 550568
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.helper;
@@ -89,6 +90,6 @@ public class GMFDiagramViewTypeHelper extends AbstractViewTypeHelper<PapyrusDiag
Diagram diagram = (Diagram) view;
PolicyChecker checker = getPolicyChecker(diagram);
- return DiagramUtils.getPrototype(diagram, checker);
+ return DiagramUtils.getPrototype(diagram, checker, false);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
index 9018362751d..9470abee5f6 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2017 CEA LIST and others.
+ * Copyright (c) 2013, 2017, 2019 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -14,6 +14,7 @@
* Benoit Maggi (Cea) benoit.maggi@cea.fr - Add utility to get the containing diagram
* Christian W. Damus - bug 527580
* Ansgar Radermacher - bug 539754
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 550568
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.utils;
@@ -173,9 +174,28 @@ public class DiagramUtils {
* A diagram
* @return The diagram's prototype
*/
- public static ViewPrototype getPrototype(Diagram diagram) {
+ public static ViewPrototype getPrototype(final Diagram diagram) {
+ return getPrototype(diagram, true);
+ }
+
+ /**
+ * Gets the prototype of a diagram
+ * Check if the selected viewpoint contains
+ * 1. the diagram model kind
+ * 2. an ancestor of the diagram model kind
+ * 3. a descendant of the diagram model kind
+ *
+ * @param diagram
+ * A diagram.
+ * @param checkViewpoint
+ * Boolean to determinate if we have to check viewpoint consistency before returning the view prototype.
+ * @return The diagram's prototype
+ *
+ * @since 3.103
+ */
+ public static ViewPrototype getPrototype(final Diagram diagram, final boolean checkViewpoint) {
PolicyChecker checker = PolicyChecker.getFor(diagram);
- return getPrototype(diagram, checker);
+ return getPrototype(diagram, checker, checkViewpoint);
}
/**
@@ -189,7 +209,25 @@ public class DiagramUtils {
*
* @since 3.2
*/
- public static ViewPrototype getPrototype(Diagram diagram, PolicyChecker checker) {
+ public static ViewPrototype getPrototype(final Diagram diagram, final PolicyChecker checker) {
+ // By default check the viewpoint consistency
+ return getPrototype(diagram, checker, true);
+ }
+
+ /**
+ * Gets the prototype of a {@code diagram} according to a given policy {@code checker}.
+ *
+ * @param diagram
+ * A diagram.
+ * @param checker
+ * A policy checker.
+ * @param checkViewpoint
+ * Boolean to determinate if we have to check viewpoint consistency before returning the view prototype.
+ * @return the policy {@code checker}'s prototype for the {@code diagram}
+ *
+ * @since 3.103
+ */
+ public static ViewPrototype getPrototype(final Diagram diagram, final PolicyChecker checker, final boolean checkViewpoint) {
PapyrusDiagramStyle pvs = getPapyrusDiagramStyle(diagram);
if (pvs != null) {
ArchitectureDomainManager manager = ArchitectureDomainManager.getInstance();
@@ -204,7 +242,7 @@ public class DiagramUtils {
// Check if the selected viewpoint contains the diagram model kind
if (repKind != null) {
- if (checker.isInViewpoint(repKind)) {
+ if (!checkViewpoint || checker.isInViewpoint(repKind)) {
return ViewPrototype.get(repKind);
}

Back to the top