01: package newprocess.diagram.edit.policies;
02:
03: import newprocess.NewprocessPackage;
04: import newprocess.diagram.edit.commands.ConditionCreateCommand;
05: import newprocess.diagram.providers.New_processElementTypes;
06:
07: import org.eclipse.gef.commands.Command;
08: import org.eclipse.gef.commands.UnexecutableCommand;
09: import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
10: import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
11:
12: /**
13: * @generated
14: */
15: public class GlobalsGlobalsConditionCompartmentItemSemanticEditPolicy
16: extends New_processBaseItemSemanticEditPolicy {
17:
18: /**
19: * @generated
20: */
21: protected Command getCreateCommand(CreateElementRequest req) {
22: if (New_processElementTypes.Condition_3014 == req
23: .getElementType()) {
24: if (req.getContainmentFeature() == null) {
25: req.setContainmentFeature(NewprocessPackage.eINSTANCE
26: .getGlobals_HasCondition());
27: }
28: return getMSLWrapper(new ConditionCreateCommand(req));
29: }
30: return super .getCreateCommand(req);
31: }
32:
33: @Override
34: protected Command getDestroyElementCommand(DestroyElementRequest req) {
35: return UnexecutableCommand.INSTANCE;
36: }
37: }
|