01: package newprocess.diagram.edit.policies;
02:
03: import org.eclipse.gef.commands.Command;
04: import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
05: import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
06: import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
07: import org.eclipse.emf.ecore.EObject;
08: import org.eclipse.emf.ecore.EAnnotation;
09: import org.eclipse.gmf.runtime.notation.View;
10:
11: /**
12: * @generated
13: */
14: public class ConditionItemSemanticEditPolicy extends
15: New_processBaseItemSemanticEditPolicy {
16:
17: /**
18: * @generated
19: */
20: protected Command getDestroyElementCommand(DestroyElementRequest req) {
21: return getMSLWrapper(new DestroyElementCommand(req) {
22:
23: protected EObject getElementToDestroy() {
24: View view = (View) getHost().getModel();
25: EAnnotation annotation = view
26: .getEAnnotation("Shortcut"); //$NON-NLS-1$
27: if (annotation != null) {
28: return view;
29: }
30: return super .getElementToDestroy();
31: }
32:
33: });
34: }
35:
36: /**
37: * @generated
38: */
39: protected Command getCreateRelationshipCommand(
40: CreateRelationshipRequest req) {
41: return super.getCreateRelationshipCommand(req);
42: }
43: }
|