01: package newprocess.diagram.edit.parts;
02:
03: import newprocess.diagram.edit.policies.GlobalsGlobalsConditionCompartmentCanonicalEditPolicy;
04: import newprocess.diagram.edit.policies.GlobalsGlobalsConditionCompartmentItemSemanticEditPolicy;
05:
06: import org.eclipse.draw2d.IFigure;
07: import org.eclipse.emf.common.notify.Notification;
08: import org.eclipse.gef.EditPolicy;
09: import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
10: import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
11: import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
12: import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
13: import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
14: import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
15: import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
16: import org.eclipse.gmf.runtime.notation.View;
17:
18: /**
19: * @generated
20: */
21: public class GlobalsGlobalsConditionCompartmentEditPart extends
22: ListCompartmentEditPart {
23:
24: /**
25: * @generated
26: */
27: public static final int VISUAL_ID = 7020;
28:
29: /**
30: * @generated
31: */
32: public GlobalsGlobalsConditionCompartmentEditPart(View view) {
33: super (view);
34: }
35:
36: /**
37: * @generated
38: */
39: protected boolean hasModelChildrenChanged(Notification evt) {
40: return false;
41: }
42:
43: /**
44: * @generated
45: */
46: public String getCompartmentName() {
47: return "GlobalsConditionCompartment";
48: }
49:
50: /**
51: * @generated NOT
52: * @author sh
53: */
54: public IFigure createFigure() {
55: ResizableCompartmentFigure result = (ResizableCompartmentFigure) super
56: .createFigure();
57: result.setTitleVisibility(false);
58:
59: //*****************Extensions****************************
60: ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
61: layout.setStretchMajorAxis(false);
62: layout.setStretchMinorAxis(true);
63: layout.setMinorAlignment(ConstrainedToolbarLayout.ALIGN_CENTER);
64: result.getContentPane().setLayoutManager(layout);
65: //*******************************************************
66: return result;
67: }
68:
69: /**
70: * @generated
71: */
72: protected void createDefaultEditPolicies() {
73: super .createDefaultEditPolicies();
74: installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
75: new ResizableCompartmentEditPolicy());
76: installEditPolicy(
77: EditPolicyRoles.SEMANTIC_ROLE,
78: new GlobalsGlobalsConditionCompartmentItemSemanticEditPolicy());
79: installEditPolicy(EditPolicyRoles.CREATION_ROLE,
80: new CreationEditPolicy());
81: installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
82: new DragDropEditPolicy());
83: installEditPolicy(
84: EditPolicyRoles.CANONICAL_ROLE,
85: new GlobalsGlobalsConditionCompartmentCanonicalEditPolicy());
86: }
87:
88: /**
89: * @generated
90: */
91: protected void setRatio(Double ratio) {
92: if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
93: super.setRatio(ratio);
94: }
95: }
96: }
|