Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 364828
Collapse All | Expand All

(-)custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java (+39 lines)
Lines 21-40 Link Here
21
import org.eclipse.gef.EditPart;
21
import org.eclipse.gef.EditPart;
22
import org.eclipse.gef.commands.Command;
22
import org.eclipse.gef.commands.Command;
23
import org.eclipse.gef.commands.CompoundCommand;
23
import org.eclipse.gef.commands.CompoundCommand;
24
import org.eclipse.gef.commands.UnexecutableCommand;
25
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
26
import org.eclipse.gmf.runtime.common.core.command.ICommand;
24
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
27
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
25
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
28
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
26
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
29
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
27
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
30
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
28
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
31
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
29
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
32
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
33
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
34
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
30
import org.eclipse.gmf.runtime.notation.View;
35
import org.eclipse.gmf.runtime.notation.View;
36
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
37
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
31
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
38
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
39
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
33
import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
40
import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
34
import org.eclipse.uml2.uml.Element;
41
import org.eclipse.uml2.uml.Element;
42
import org.eclipse.uml2.uml.Event;
35
import org.eclipse.uml2.uml.ExecutionSpecification;
43
import org.eclipse.uml2.uml.ExecutionSpecification;
36
import org.eclipse.uml2.uml.Message;
44
import org.eclipse.uml2.uml.Message;
37
import org.eclipse.uml2.uml.MessageEnd;
45
import org.eclipse.uml2.uml.MessageEnd;
46
import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
38
import org.eclipse.uml2.uml.OccurrenceSpecification;
47
import org.eclipse.uml2.uml.OccurrenceSpecification;
39
48
40
/**
49
/**
Lines 201-204 Link Here
201
			}
210
			}
202
		}
211
		}
203
	}
212
	}
213
	
214
	public static Command completeDeleteMessageCommand(DestroyElementRequest req) {
215
		EObject selectedEObject = req.getElementToDestroy();
216
		IElementEditService provider = ElementEditServiceUtils
217
				.getCommandProvider(selectedEObject);
218
		if (provider != null) {
219
			// Retrieve delete command from the Element Edit service
220
			ICommand deleteCommand = provider.getEditCommand(req);
221
			if (deleteCommand != null) {
222
				CompositeCommand command = new CompositeCommand(
223
						deleteCommand.getLabel());
224
				command.add(deleteCommand);
225
				Message message = (Message) selectedEObject;
226
				MessageEnd receiveEvent = message.getReceiveEvent();
227
				if (receiveEvent != null) {
228
					DestroyElementRequest myReq = new DestroyElementRequest(
229
							req.getEditingDomain(), receiveEvent, false);
230
					command.add(new DestroyElementCommand(myReq));
231
				}
232
				MessageEnd sendEvent = message.getSendEvent();
233
				if (sendEvent != null) {
234
					DestroyElementRequest myReq = new DestroyElementRequest(
235
							req.getEditingDomain(), sendEvent, false);
236
					command.add(new DestroyElementCommand(myReq));
237
				}
238
				return new ICommandProxy(command);
239
			}
240
		}
241
		return UnexecutableCommand.INSTANCE;
242
	}
204
}
243
}
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 92-111 Link Here
92
	/**
86
	/**
93
	 * the added code to delete the messageoccurencespecification when the message is deleted
87
	 * the added code to delete the messageoccurencespecification when the message is deleted
94
	 * 
88
	 * 
95
	 * @generated
89
	 * @generated NOT
96
	 */
90
	 */
97
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
91
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
98
		EObject selectedEObject = req.getElementToDestroy();
92
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
99
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
100
		if(provider != null) {
101
			// Retrieve delete command from the Element Edit service
102
			ICommand deleteCommand = provider.getEditCommand(req);
103
104
			if(deleteCommand != null) {
105
				return new ICommandProxy(deleteCommand);
106
			}
107
		}
108
		return UnexecutableCommand.INSTANCE;
109
	}
93
	}
110
94
111
	/**
95
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**
(-)src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java (-18 / +2 lines)
Lines 13-25 Link Here
13
 *****************************************************************************/
13
 *****************************************************************************/
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
14
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
15
15
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.gef.commands.Command;
16
import org.eclipse.gef.commands.Command;
18
import org.eclipse.gef.commands.CompoundCommand;
17
import org.eclipse.gef.commands.CompoundCommand;
19
import org.eclipse.gef.commands.UnexecutableCommand;
20
import org.eclipse.gmf.runtime.common.core.command.ICommand;
21
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
18
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
22
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
20
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
25
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
21
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
Lines 27-34 Link Here
27
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
23
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
28
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
24
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
29
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
30
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
31
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
32
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
26
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
33
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
27
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
34
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
28
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
Lines 90-109 Link Here
90
	}
84
	}
91
85
92
	/**
86
	/**
93
	 * @generated
87
	 * @generated NOT
94
	 */
88
	 */
95
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
89
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
96
		EObject selectedEObject = req.getElementToDestroy();
90
		return SequenceDeleteHelper.completeDeleteMessageCommand(req);
97
		IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
98
		if(provider != null) {
99
			// Retrieve delete command from the Element Edit service
100
			ICommand deleteCommand = provider.getEditCommand(req);
101
102
			if(deleteCommand != null) {
103
				return new ICommandProxy(deleteCommand);
104
			}
105
		}
106
		return UnexecutableCommand.INSTANCE;
107
	}
91
	}
108
92
109
	/**
93
	/**

Return to bug 364828