Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-08-09 08:01:47 +0000
committerPatrick Tessier2017-08-10 08:45:49 +0000
commit9c8056f42ca11ad2ea2e9eae9dac98899d6e877c (patch)
tree4dc896748c9258fa7806e12329fc11b7045e6fc9
parentc2bf3f228fa7e312badcc2491ae44570f926b394 (diff)
downloadorg.eclipse.papyrus-9c8056f42ca11ad2ea2e9eae9dac98899d6e877c.tar.gz
org.eclipse.papyrus-9c8056f42ca11ad2ea2e9eae9dac98899d6e877c.tar.xz
org.eclipse.papyrus-9c8056f42ca11ad2ea2e9eae9dac98899d6e877c.zip
Bug 520733: [All Diagram] method UMLViewProvider.provides(IOperation) must be more restrictive
Change-Id: I683efc30237163e6f21efd7b1797f80e67e107a5 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
index 5974f0b7019..bb610d57672 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/ViewProvider.xtend
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others
+ * Copyright (c) 2007, 2010, 2013, 2017 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -13,6 +13,7 @@
* Thibault Landre (Atos Origin) - initial API and implementation
* Vincent Lorenzo (CEA-LIST) Add a line to initialize the display of the compartments to true
* Vincent Lorenzo (CEA-LIST) - Add lines to initialize the display of the labels - Bug 335987 [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
+ * Vincent Lorenzo (CEA-LIST) - Bug 520733
*/
package aspects.xpt.providers
@@ -66,6 +67,16 @@ import xpt.editor.VisualIDRegistry
return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation) operation);
}
«_assert('operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation')»
+
+ /* we check this view provider is the good one for the currently edited diagram */
+ if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateChildViewOperation) {
+ View container = ((org.eclipse.gmf.runtime.diagram.core.services.view.CreateChildViewOperation) operation).getContainerView();
+ Diagram diagram = container.getDiagram();
+ if(!getDiagramProvidedId().equals(diagram.getType())) {
+ return false;
+ }
+ }
+
if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation) {
return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation) operation);
} else if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation) {

Back to the top