01: package newprocess.diagram.edit.commands;
02:
03: import newprocess.Event;
04: import newprocess.NewprocessPackage;
05:
06: import org.eclipse.emf.ecore.EClass;
07: import org.eclipse.emf.ecore.EObject;
08:
09: import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
10:
11: import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
12:
13: import org.eclipse.gmf.runtime.notation.View;
14:
15: /**
16: * @generated
17: */
18: public class Expression6CreateCommand extends CreateElementCommand {
19:
20: /**
21: * @generated
22: */
23: public Expression6CreateCommand(CreateElementRequest req) {
24: super (req);
25: }
26:
27: /**
28: * @generated
29: */
30: protected EClass getEClassToEdit() {
31: return NewprocessPackage.eINSTANCE.getEvent();
32: };
33:
34: /**
35: * @generated
36: */
37: protected EObject getElementToEdit() {
38: EObject container = ((CreateElementRequest) getRequest())
39: .getContainer();
40: if (container instanceof View) {
41: container = ((View) container).getElement();
42: }
43: return container;
44: }
45:
46: /**
47: * @generated
48: */
49: public boolean canExecute() {
50: Event container = (Event) getElementToEdit();
51: if (container.getHasPostcondition() != null) {
52: return false;
53: }
54: return true;
55: }
56:
57: }
|