01: package newprocess.diagram.edit.policies;
02:
03: import newprocess.Expression;
04: import newprocess.NewprocessPackage;
05: import newprocess.diagram.edit.commands.AndOperatorCreateCommand;
06: import newprocess.diagram.edit.commands.OrOperatorCreateCommand;
07: import newprocess.diagram.providers.New_processElementTypes;
08:
09: import org.eclipse.gef.commands.Command;
10: import org.eclipse.gef.commands.UnexecutableCommand;
11: import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
12: import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
13:
14: /**
15: * @generated
16: */
17: public class ExpressionExpressionCompartment8ItemSemanticEditPolicy
18: extends New_processBaseItemSemanticEditPolicy {
19:
20: /**
21: * @generated NOT
22: * @author sh
23: */
24: protected Command getCreateCommand(CreateElementRequest req) {
25: if (New_processElementTypes.OrOperator_3003 == req
26: .getElementType()) {
27: if (req.getContainmentFeature() == null) {
28: req.setContainmentFeature(NewprocessPackage.eINSTANCE
29: .getExpression_HasTerms());
30: }
31: if (((Expression) req.getContainer()).acceptOperator())
32: return getMSLWrapper(new OrOperatorCreateCommand(req));
33: else
34: return UnexecutableCommand.INSTANCE;
35: }
36: if (New_processElementTypes.AndOperator_3004 == req
37: .getElementType()) {
38: if (req.getContainmentFeature() == null) {
39: req.setContainmentFeature(NewprocessPackage.eINSTANCE
40: .getExpression_HasTerms());
41: }
42: if (((Expression) req.getContainer()).acceptOperator())
43: return getMSLWrapper(new AndOperatorCreateCommand(req));
44: else
45: return UnexecutableCommand.INSTANCE;
46: }
47: return super .getCreateCommand(req);
48: }
49:
50: @Override
51: protected Command getDestroyElementCommand(DestroyElementRequest req) {
52: return UnexecutableCommand.INSTANCE;
53: }
54: }
|