Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2019-05-24 10:20:37 -0400
committerNicolas FAUVERGUE2019-06-17 09:39:19 -0400
commitd756c26b0f0fc8cd947cad71e19419aa8a8ced64 (patch)
treedfda5ea5256d764391f758fa1991dc07dafe5591 /plugins
parente47cce9fbe7fc51056abdf4625f71164fbdd97b9 (diff)
downloadorg.eclipse.papyrus-d756c26b0f0fc8cd947cad71e19419aa8a8ced64.tar.gz
org.eclipse.papyrus-d756c26b0f0fc8cd947cad71e19419aa8a8ced64.tar.xz
org.eclipse.papyrus-d756c26b0f0fc8cd947cad71e19419aa8a8ced64.zip
Bug 547864 - [SequenceDiagram] Undo/Redo problem with CombinedFragment
Failing tests : - Some tests are failing due to incorrect tests (validation tests are no more needed because the covering is automatically recalculated) - Other tests are failing due to undo/redo problem of CombinedFragment creation. The undo creation when something is contained into the created CombinedFragment crash with exception (The undo of creation is no more possible because the elements positions changed). In this patch: I manage undo/redo of creation differently (manually) to move needed contained elements before to remove CombinedFragment. In this case, i have to cut the undo/redo of the SemanticCreationCommand. With this patch, all JUnit tests of sequence diagram works fine. Change-Id: Ib1ed2df10404763ca79e5a2c5c62bf4c52600657 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentContainerCreationEditPolicy.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/InteractionContainerDeletionContext.java19
6 files changed, 307 insertions, 24 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
index 99b1b46f00a..10d90a2eb81 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Bundle-ClassPath: .
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3.6.0,4.0.0)",
+Require-Bundle: org.eclipse.ui.navigator;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.navigator.resources;bundle-version="[3.5.0,4.0.0)",
org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)",
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.7.0,2.0.0)",
@@ -24,12 +24,12 @@ Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3
org.eclipse.ocl.ecore;bundle-version="[3.5.0,4.0.0)",
org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="[3.0.0,4.0.0)",
org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.papyrus.uml.service.types;bundle-version="[4.0.0,5.0.0)",
+ org.eclipse.papyrus.uml.service.types;bundle-version="[4.2.0,5.0.0)",
org.eclipse.papyrus.uml.appearance;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="[2.9.0,3.0.0)",
- org.eclipse.emf.validation;visibility:=reexport;bundle-version="[1.8.0,2.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.validation;bundle-version="[1.8.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.gmfdiag.hyperlink;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
@@ -54,8 +54,8 @@ Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3
org.eclipse.gmf.runtime.diagram.ui.properties,
org.eclipse.gmf.runtime.diagram.ui.providers,
org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.uml2.uml;visibility:=reexport;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.uml2.uml.edit;visibility:=reexport;bundle-version="[5.3.0,6.0.0)",
+ org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)";visibility:=reexport,
+ org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)";visibility:=reexport,
org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
org.eclipse.gef,
org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors;bundle-version="[1.0.0,2.0.0)",
@@ -70,7 +70,7 @@ Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3
org.eclipse.papyrus.uml.service.validation;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.infra.services.validation;bundle-version="[3.0.0,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 5.2.0.qualifier
+Bundle-Version: 5.2.100.qualifier
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin
Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence; singleton:=true
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentContainerCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentContainerCreationEditPolicy.java
index 3341c08f850..160f4c527b7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentContainerCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionFragmentContainerCreationEditPolicy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2018 CEA LIST, Christian W. Damus, and others.
- *
+ * Copyright (c) 2018-2019 CEA LIST, Christian W. Damus, and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,32 +10,68 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 547864
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Optional;
import java.util.Set;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.helper.advice.InteractionContainerDeletionContext;
import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
+import org.eclipse.uml2.uml.CombinedFragment;
+import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.InteractionFragment;
+import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* Custom creation edit policy for containers of {@link InteractionFragment}s, primarily
* for the creation of such fragments.
- *
+ *
* @since 5.0
*/
public class InteractionFragmentContainerCreationEditPolicy extends DefaultCreationEditPolicy {
@@ -47,6 +83,11 @@ public class InteractionFragmentContainerCreationEditPolicy extends DefaultCreat
super();
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getCreateElementAndViewCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest)
+ */
@Override
protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
IElementType typeToCreate = request.getViewAndElementDescriptor().getElementAdapter().getAdapter(IElementType.class);
@@ -61,9 +102,248 @@ public class InteractionFragmentContainerCreationEditPolicy extends DefaultCreat
}
}
+ // Create a special element and view create command for the combined fragment
+ if (ElementUtil.isTypeOf(typeToCreate, UMLElementTypes.COMBINED_FRAGMENT)) {
+ return getCreateElementAndViewCommandForCombinedFragmentWithUndo(request);
+ }
+
return super.getCreateElementAndViewCommand(request);
}
+ /**
+ * This allows to create the element and view command especially for the CombinedFragment (because we need to manage it differently for the undo).
+ *
+ * @param request
+ * The create element and view request.
+ * @return The command to create the element and its view.
+ */
+ private Command getCreateElementAndViewCommandForCombinedFragmentWithUndo(final CreateViewAndElementRequest request) {
+ final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ final Command undoCommand = new Command() {
+
+ private CombinedFragment createdCombinedFragment = null;
+
+ private EObject container = null;
+
+ private EStructuralFeature feature = null;
+
+ /**
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ @Override
+ public void undo() {
+ // We need to remove objects in InteractionOperand before deleting the created CombinedFragment
+
+ // First step, get the created CombinedFragment
+ final CombinedFragment combinedFragment = getCombinedFragment(request.getNewObject());
+
+ // If the CombinedFragment is found, continue process
+ if (null != combinedFragment) {
+
+ createdCombinedFragment = combinedFragment;
+
+ // Only one operand must be available
+ final InteractionOperand interactionOperand = combinedFragment.getOperands().get(0);
+
+ final CompositeCommand compositeCommand = new CompositeCommand("Move needed fragments"); //$NON-NLS-1$
+ // Loop on each contained fragments to move it to super container (calculated automatically)
+ for (final InteractionFragment interactionFragment : interactionOperand.getFragments()) {
+ final DestroyElementRequest request = new DestroyElementRequest(editingDomain, interactionOperand, false);
+ final Optional<InteractionContainerDeletionContext> context = InteractionContainerDeletionContext.get(request);
+ final Optional<ICommand> result = context.map(ctx -> ctx.getDestroyCommand(interactionFragment));
+
+ final ICommand undoCommand = result.get();
+ if (null != undoCommand && undoCommand.canExecute()) {
+ compositeCommand.add(undoCommand);
+ }
+ }
+
+ // If there is something to move, move it
+ if (null != compositeCommand && !compositeCommand.isEmpty() && compositeCommand.canExecute()) {
+ try {
+ compositeCommand.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ // We need to remove manually the combined fragment because it is not at the same position of the contained feature
+ container = combinedFragment.eContainer();
+ feature = container instanceof Interaction ? UMLPackage.eINSTANCE.getInteraction_Fragment() : container instanceof InteractionOperand ? UMLPackage.eINSTANCE.getInteractionOperand_Fragment() : null;
+ final AbstractTransactionalCommand abstractTransactionalCommand = new AbstractTransactionalCommand(editingDomain, "Remove CombinedFragment", Collections.singletonList(combinedFragment.eResource())) { //$NON-NLS-1$
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ final Object value = container.eGet(feature);
+ if (value instanceof List) {
+ ((List) value).remove(combinedFragment);
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ abstractTransactionalCommand.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.commands.Command#redo()
+ */
+ @Override
+ public void redo() {
+ // We need to manage the redo (only re-add the combined fragment)
+ final AbstractTransactionalCommand abstractTransactionalCommand = new AbstractTransactionalCommand(editingDomain, "Remove CombinedFragment", null) { //$NON-NLS-1$
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if (null != container && null != feature && null != createdCombinedFragment) {
+ final Object value = container.eGet(feature);
+ if (value instanceof List) {
+ ((List) value).add(createdCombinedFragment);
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ abstractTransactionalCommand.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+ };
+
+ return undoCommand.chain(getCreateElementAndViewCommandForCombinedFragment(request));
+ }
+
+ /**
+ * Method getCreateElementAndViewCommand for the CombinedFragment.
+ * Copied from 'getCreateElementAndViewCommand' super implementation.
+ *
+ * @param request
+ * The create element and view request.
+ * @return Command Which creates the semantic and the view command for the given CreateViewAndElementRequest.
+ */
+ private Command getCreateElementAndViewCommandForCombinedFragment(final CreateViewAndElementRequest request) {
+ // get the element descriptor
+ final CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
+
+ // get the semantic request
+ final CreateElementRequest createElementRequest = (CreateElementRequest) requestAdapter.getAdapter(CreateElementRequest.class);
+
+ if (createElementRequest.getContainer() == null) {
+ // complete the semantic request by filling in the host's semantic element as the context
+ final View view = (View) getHost().getModel();
+ EObject hostElement = ViewUtil.resolveSemanticElement(view);
+
+ if (hostElement == null && view.getElement() == null) {
+ hostElement = view;
+ }
+
+ // Returns null if host is unresolvable so that trying to create a
+ // new element in an unresolved shape will not be allowed.
+ if (hostElement == null) {
+ return null;
+ }
+ createElementRequest.setContainer(hostElement);
+ }
+
+ // get the create element command based on the elementdescriptor's request
+ final Command createElementCommand = getHost().getCommand(
+ new EditCommandRequestWrapper(
+ (CreateElementRequest) requestAdapter.getAdapter(
+ CreateElementRequest.class),
+ request.getExtendedData()));
+
+ if (createElementCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (!createElementCommand.canExecute()) {
+ return createElementCommand;
+ }
+ // create the semantic create wrapper command
+ final SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand) {
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand#doUndoWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param progressMonitor
+ * @param info
+ * @return
+ * @throws ExecutionException
+ */
+ @Override
+ protected CommandResult doUndoWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException {
+ // We need to do nothing
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand#doRedoWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param progressMonitor
+ * @param info
+ * @return
+ * @throws ExecutionException
+ */
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // We need to do nothing
+ return CommandResult.newOKCommandResult();
+ }
+
+ };
+ final Command viewCommand = getCreateCommand(request);
+
+ final Command refreshConnectionCommand = getHost().getCommand(
+ new RefreshConnectionsRequest(((List<?>) request.getNewObject())));
+
+
+ // form the compound command and return
+ final CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
+ cc.compose(semanticCommand);
+ cc.compose(new CommandProxy(viewCommand));
+ if (refreshConnectionCommand != null) {
+ cc.compose(new CommandProxy(refreshConnectionCommand));
+ }
+
+ return new ICommandProxy(cc);
+ }
+
+ /**
+ * This allows to get the CombinedFragment from the object in the create element and view request.
+ *
+ * @param newObject
+ * The object in the create element and view request.
+ * @return The created CombinedFragment or <code>null</code>.
+ */
+ private CombinedFragment getCombinedFragment(final Object newObject) {
+ CombinedFragment result = null;
+
+ if (newObject instanceof Collection) {
+ final Iterator<?> collectionIt = ((Collection<?>) newObject).iterator();
+ while (collectionIt.hasNext() && null == result) {
+ final Object next = collectionIt.next();
+ result = getCombinedFragment(next);
+ }
+ } else if (newObject instanceof CombinedFragment) {
+ result = (CombinedFragment) newObject;
+ } else if (newObject instanceof ViewAndElementDescriptor && null != ((ViewAndElementDescriptor) newObject).getCreateElementRequestAdapter()) {
+ final CreateElementRequest createElementRequest = (CreateElementRequest) ((ViewAndElementDescriptor) newObject).getCreateElementRequestAdapter().getAdapter(CreateElementRequest.class);
+ if (null != createElementRequest) {
+ final EObject eObject = createElementRequest.getNewElement();
+ if (eObject instanceof CombinedFragment) {
+ result = (CombinedFragment) eObject;
+ }
+ }
+ }
+
+ return result;
+ }
+
protected Rectangle getCreationRectangle(CreateViewAndElementRequest request) {
Point location = request.getLocation();
Dimension size = request.getSize();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
index 37b2326dc68..170272d1c8d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.sequence</artifactId>
- <version>5.2.0-SNAPSHOT</version>
+ <version>5.2.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
index 46a9046e9a2..f62aba85419 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.
org.eclipse.papyrus.infra.emf.gmf;bundle-version="[1.2.100,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 4.1.100.qualifier
+Bundle-Version: 4.2.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.uml.service.types.Activator
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
index c340eeb9385..dd6f64cab52 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.service.types</artifactId>
- <version>4.1.100-SNAPSHOT</version>
+ <version>4.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/InteractionContainerDeletionContext.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/InteractionContainerDeletionContext.java
index 82df13bce41..a3262ccaab6 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/InteractionContainerDeletionContext.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/InteractionContainerDeletionContext.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2018 Christian W. Damus and others.
- *
+ * Copyright (c) 2018-2019 CEA LIST, Christian W. Damus and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,8 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 547864
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.helper.advice;
@@ -45,8 +46,10 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* A {@link DestroyElementRequest} parameter tracking the deletion of {@link InteractionFragment}
* containers in the context of an {@link Interaction}.
+ *
+ * @since 4.2
*/
-class InteractionContainerDeletionContext {
+public class InteractionContainerDeletionContext {
private static String PARAMETER_NAME = "papyrus.uml.InteractionContainerDeletionContext"; //$NON-NLS-1$
@@ -71,7 +74,7 @@ class InteractionContainerDeletionContext {
request.setParameter(PARAMETER_NAME, this);
}
- static Optional<InteractionContainerDeletionContext> get(DestroyElementRequest request) {
+ public static Optional<InteractionContainerDeletionContext> get(DestroyElementRequest request) {
return get(request, request.getElementToDestroy());
}
@@ -127,7 +130,7 @@ class InteractionContainerDeletionContext {
/**
* Query the new container into which a {@code fragment} should be moved instead of
* destroyed.
- *
+ *
* @param fragment
* a fragment for which destruction is requested
* @return the container, either an {@link Interaction} or an {@link InteractionOperand},
@@ -141,7 +144,7 @@ class InteractionContainerDeletionContext {
/**
* Query the new container into which a {@code generalOrdering} should be moved instead of
* destroyed.
- *
+ *
* @param generalOrdering
* a general ordering for which destruction is requested
* @return the container, either an {@link Interaction} or an {@link InteractionOperand},
@@ -180,7 +183,7 @@ class InteractionContainerDeletionContext {
return result;
}
- ICommand getDestroyCommand(InteractionFragment fragment) {
+ public ICommand getDestroyCommand(InteractionFragment fragment) {
InteractionFragment container = getNewContainerFor(fragment);
return container != null ? move(fragment, container) : null;
}

Back to the top