01: package newprocess.diagram.edit.parts;
02:
03: import newprocess.diagram.edit.policies.GlobalsGlobalsLoaderCompartmentCanonicalEditPolicy;
04: import newprocess.diagram.edit.policies.GlobalsGlobalsLoaderCompartmentItemSemanticEditPolicy;
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 GlobalsGlobalsLoaderCompartmentEditPart extends
22: ListCompartmentEditPart {
23:
24: /**
25: * @generated
26: */
27: public static final int VISUAL_ID = 7019;
28:
29: /**
30: * @generated
31: */
32: public GlobalsGlobalsLoaderCompartmentEditPart(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 "GlobalsLoaderCompartment";
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: //result.setMaximumSize(new Dimension(getMapMode().DPtoLP(result.getBounds().width), getMapMode().DPtoLP(25)));
67: //result.setMinimumSize(new Dimension(getMapMode().DPtoLP(result.getBounds().width), getMapMode().DPtoLP(25)));
68: //*******************************************************
69: return result;
70: }
71:
72: /**
73: * @generated
74: */
75: protected void createDefaultEditPolicies() {
76: super .createDefaultEditPolicies();
77: installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
78: new ResizableCompartmentEditPolicy());
79: installEditPolicy(
80: EditPolicyRoles.SEMANTIC_ROLE,
81: new GlobalsGlobalsLoaderCompartmentItemSemanticEditPolicy());
82: installEditPolicy(EditPolicyRoles.CREATION_ROLE,
83: new CreationEditPolicy());
84: installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
85: new DragDropEditPolicy());
86: installEditPolicy(
87: EditPolicyRoles.CANONICAL_ROLE,
88: new GlobalsGlobalsLoaderCompartmentCanonicalEditPolicy());
89: }
90:
91: /**
92: * @generated
93: */
94: protected void setRatio(Double ratio) {
95: if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
96: super.setRatio(ratio);
97: }
98: }
99: }
|