diff options
author | Camille Letavernier | 2018-04-18 14:19:03 +0000 |
---|---|---|
committer | Nicolas FAUVERGUE | 2018-05-22 15:59:19 +0000 |
commit | 9714b7607b138a564456b44221a927faeece9b6e (patch) | |
tree | 24baf74e72ae28f54feeccd99f161749910ca76c /plugins/uml | |
parent | 35f5a0c41fc41805277fbebfc3a090077e9fd562 (diff) | |
download | org.eclipse.papyrus-9714b7607b138a564456b44221a927faeece9b6e.tar.gz org.eclipse.papyrus-9714b7607b138a564456b44221a927faeece9b6e.tar.xz org.eclipse.papyrus-9714b7607b138a564456b44221a927faeece9b6e.zip |
Bug 533701: [Sequence Diagram] Stereotype or Shape Compartments should
not
be displayed in CombinedFragments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533701
Add 2 services, to support filtering generic Papyrus IViewProviders and
IEditPolicyProviders. Also add a simple contribution for the Sequence
Diagram, to disable Symbols compartments.
Change-Id: I0d6e1af0ad4395daf3170409b5735df36dd02d46
Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Diffstat (limited to 'plugins/uml')
18 files changed, 248 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java index 5a5c0c9ab92..bcf1781579d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java @@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPolicies import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider; import org.eclipse.papyrus.infra.core.services.ServicesRegistry; import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ProviderServiceUtil; import org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractNameReferencesListenerEditPolicy; import org.eclipse.papyrus.uml.diagram.common.editpolicies.CommentReferencesListenerEditPolicy; import org.eclipse.papyrus.uml.tools.utils.UMLUtil; @@ -38,6 +39,9 @@ public class CommentEditPolicyProvider extends AbstractProvider implements IEdit @Override public boolean provides(IOperation operation) { CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation; + if (!ProviderServiceUtil.isEnabled(this, epOperation.getEditPart())) { + return false; + } Element element = UMLUtil.resolveUMLElement(epOperation.getEditPart()); if (!(element instanceof Comment)) { return false; diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CustomEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CustomEditPolicyProvider.java index 82506653ac6..8f770c24028 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CustomEditPolicyProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CustomEditPolicyProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2015 CEA LIST 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 @@ -8,7 +8,7 @@ * * Contributors: * Fanch Bonnabesse (ALL4TEC) fanch.bonnabesse@alltec.net - Bug 419357 - * + * *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.common.providers; @@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPolicies import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart; import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ProviderServiceUtil; import org.eclipse.papyrus.uml.diagram.common.editpolicies.CustomDefaultSemanticEditPolicy; /** @@ -35,6 +36,9 @@ public class CustomEditPolicyProvider extends AbstractProvider implements IEditP public boolean provides(final IOperation operation) { if (operation instanceof CreateEditPoliciesOperation) { final EditPart editPart = ((CreateEditPoliciesOperation) operation).getEditPart(); + if (!ProviderServiceUtil.isEnabled(this, editPart)) { + return false; + } if (editPart instanceof NodeEditPart) { final EditPolicy editPolicy = editPart.getEditPolicy(EditPolicyRoles.SEMANTIC_ROLE); if (null != editPolicy) { diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.classpath b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.project b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.project new file mode 100644 index 00000000000..e6d127a09a4 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.uml.diagram.sequence.restrictions</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ds.core.builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.pde.ds.annotations.prefs b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 00000000000..73a356b6d05 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,8 @@ +classpath=true +dsVersion=V1_3 +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..2c9c9d70ad4 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SequenceDiagram Restrictions +Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence.restrictions +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Eclipse Modeling Project +Automatic-Module-Name: org.eclipse.papyrus.uml.diagram.sequence.restrictions +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Service-Component: OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester.xml, + OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester.xml +Require-Bundle: org.eclipse.papyrus.uml.diagram.sequence;bundle-version="5.0.0", + org.eclipse.papyrus.infra.gmfdiag.common, + org.eclipse.papyrus.uml.diagram.symbols;bundle-version="1.2.0" +Import-Package: org.osgi.service.component.annotations;version="1.3.0";resolution:=optional diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester.xml new file mode 100644 index 00000000000..f45599187af --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester"> + <service> + <provide interface="org.eclipse.papyrus.infra.gmfdiag.common.service.EditPolicyProviderTester"/> + </service> + <implementation class="org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceEditPolicyProviderTester"/> +</scr:component>
\ No newline at end of file diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester.xml new file mode 100644 index 00000000000..a7f239b7d7a --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/OSGI-INF/org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester"> + <service> + <provide interface="org.eclipse.papyrus.infra.gmfdiag.common.service.ViewProviderTester"/> + </service> + <implementation class="org.eclipse.papyrus.uml.diagram.sequence.restrictions.SequenceViewProviderTester"/> +</scr:component>
\ No newline at end of file diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/about.html b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/build.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/build.properties new file mode 100644 index 00000000000..30c35d74ee2 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + about.html +src.includes = about.html diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/pom.xml new file mode 100644 index 00000000000..906786fae58 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/pom.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.uml-diagrams</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.uml.diagram.sequence.restrictions</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project>
\ No newline at end of file diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceEditPolicyProviderTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceEditPolicyProviderTester.java new file mode 100644 index 00000000000..6acb2792bcf --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceEditPolicyProviderTester.java @@ -0,0 +1,42 @@ +/***************************************************************************** + * Copyright (c) 2018 EclipseSource 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.sequence.restrictions; + +import org.eclipse.gef.EditPart; +import org.eclipse.gef.RootEditPart; +import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider; +import org.eclipse.papyrus.infra.gmfdiag.common.service.EditPolicyProviderTester; +import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart; +import org.eclipse.papyrus.uml.diagram.symbols.provider.ShapeEditPolicyProvider; +import org.osgi.service.component.annotations.Component; + +@Component +public class SequenceEditPolicyProviderTester implements EditPolicyProviderTester { + + @Override + public boolean isEnabled(IEditPolicyProvider provider, EditPart editPart) { + if (isSequenceDiagram(editPart)) { + if (provider instanceof ShapeEditPolicyProvider) { + return false; + } + return true; + } + return true; + } + + private boolean isSequenceDiagram(EditPart editPart) { + RootEditPart root = editPart.getRoot(); + return root != null && root.getContents() instanceof SequenceDiagramEditPart; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceViewProviderTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceViewProviderTester.java new file mode 100644 index 00000000000..438a3357232 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.restrictions/src/org/eclipse/papyrus/uml/diagram/sequence/restrictions/SequenceViewProviderTester.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2018 EclipseSource 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.sequence.restrictions; + +import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ViewProviderTester; +import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.SequenceDiagramEditPart; +import org.eclipse.papyrus.uml.diagram.symbols.provider.ShapeCompartmentViewProvider; +import org.osgi.service.component.annotations.Component; + +@Component +public class SequenceViewProviderTester implements ViewProviderTester { + + @Override + public boolean isEnabled(IViewProvider provider, View view) { + if (isSequenceDiagram(view)) { + if (provider instanceof ShapeCompartmentViewProvider) { + return false; + } + return true; + } + return true; + } + + private boolean isSequenceDiagram(View view) { + // XXX Should we use Architecture? We probably want to restrain only what we + // know, + // and let extension plug-ins provide their own restrictions if they need to. + Diagram diagram = view.getDiagram(); + return diagram != null && SequenceDiagramEditPart.MODEL_ID.equals(diagram.getType()); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java index f6dfd08d726..c36ef86bcd9 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java @@ -24,6 +24,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvide import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ProviderServiceUtil; import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart; import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart; import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart; @@ -44,6 +45,7 @@ public class CustomEditPolicyProvider extends AbstractProvider implements IEditP * * {@inheritDoc} */ + @Override public void createEditPolicies(EditPart editPart) { if (editPart instanceof IPapyrusEditPart) { if (!(editPart instanceof AppliedStereotypeMultilinePropertyEditPart)) { @@ -71,8 +73,13 @@ public class CustomEditPolicyProvider extends AbstractProvider implements IEditP * * {@inheritDoc} */ + @Override public boolean provides(IOperation operation) { CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation; + if (!ProviderServiceUtil.isEnabled(this, epOperation.getEditPart())) { + return false; + } + if (!(epOperation.getEditPart() instanceof GraphicalEditPart) && !(epOperation.getEditPart() instanceof ConnectionEditPart)) { return false; } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeCompartmentViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeCompartmentViewProvider.java index 6eb8fd16420..9d85d27aac4 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeCompartmentViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeCompartmentViewProvider.java @@ -19,6 +19,7 @@ import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOpera import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IShapeCompartmentEditPart; import org.eclipse.papyrus.infra.gmfdiag.common.providers.AbstractShapeCompartmentViewProvider; import org.eclipse.papyrus.infra.gmfdiag.common.providers.GraphicalTypeRegistry; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ProviderServiceUtil; /** * View Provider for Internal Block Diagram. It adds the shape compartment edit parts @@ -50,6 +51,9 @@ public class ShapeCompartmentViewProvider extends AbstractShapeCompartmentViewPr */ @Override protected boolean provides(CreateNodeViewOperation operation) { + if (!ProviderServiceUtil.isEnabled(this, operation.getContainerView())) { + return false; + } return (getNodeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint()) != null); } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeEditPolicyProvider.java index 9b70c6595dd..c744fd84a7e 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeEditPolicyProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols/src/org/eclipse/papyrus/uml/diagram/symbols/provider/ShapeEditPolicyProvider.java @@ -23,6 +23,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPolicies import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart; import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ShapeCompartmentEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.service.ProviderServiceUtil; import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart; import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedBorderNamedElementEditPart; import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure; @@ -39,6 +40,9 @@ public class ShapeEditPolicyProvider extends AbstractProvider implements IEditPo @Override public boolean provides(IOperation operation) { CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation; + if (!ProviderServiceUtil.isEnabled(this, epOperation.getEditPart())) { + return false; + } if (!(epOperation.getEditPart() instanceof IGraphicalEditPart)) { return false; } @@ -47,7 +51,7 @@ public class ShapeEditPolicyProvider extends AbstractProvider implements IEditPo IGraphicalEditPart gep = (IGraphicalEditPart) epOperation.getEditPart(); return provides(gep); } - + /** * {@inheritDoc} */ @@ -61,7 +65,9 @@ public class ShapeEditPolicyProvider extends AbstractProvider implements IEditPo /** * check whether edit part provides a symbol compartment - * @param the edit part + * + * @param the + * edit part * @return */ protected boolean provides(EditPart ep) { diff --git a/plugins/uml/diagram/pom.xml b/plugins/uml/diagram/pom.xml index 7920a0f8da0..647e89ad302 100644 --- a/plugins/uml/diagram/pom.xml +++ b/plugins/uml/diagram/pom.xml @@ -30,6 +30,7 @@ <module>org.eclipse.papyrus.uml.diagram.navigation</module> <module>org.eclipse.papyrus.uml.diagram.profile</module> <module>org.eclipse.papyrus.uml.diagram.sequence</module> + <module>org.eclipse.papyrus.uml.diagram.sequence.restrictions</module> <module>org.eclipse.papyrus.uml.diagram.statemachine</module> <module>org.eclipse.papyrus.uml.diagram.stereotype.edition</module> <module>org.eclipse.papyrus.uml.diagram.symbols</module> |