1 | /* |
2 | * Copyright 2006 SDQ Research Group, University of Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.seff.edit.parts; |
5 | |
6 | import org.eclipse.draw2d.IFigure; |
7 | import org.eclipse.emf.common.notify.Notification; |
8 | import org.eclipse.gef.EditPolicy; |
9 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; |
11 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
12 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
13 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
14 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; |
15 | import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
16 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
17 | import org.eclipse.gmf.runtime.notation.View; |
18 | |
19 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.InternalActionInfrastructureCallsCompartmentCanonicalEditPolicy; |
20 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.InternalActionInfrastructureCallsCompartmentItemSemanticEditPolicy; |
21 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
22 | |
23 | /** |
24 | * @generated |
25 | */ |
26 | public class InternalActionInfrastructureCallsCompartmentEditPart extends |
27 | ListCompartmentEditPart { |
28 | |
29 | /** |
30 | * @generated |
31 | */ |
32 | public static final int VISUAL_ID = 7048; |
33 | |
34 | /** |
35 | * @generated |
36 | */ |
37 | public InternalActionInfrastructureCallsCompartmentEditPart(View view) { |
38 | super(view); |
39 | } |
40 | |
41 | /** |
42 | * @generated |
43 | */ |
44 | protected boolean hasModelChildrenChanged(Notification evt) { |
45 | return false; |
46 | } |
47 | |
48 | /** |
49 | * @generated |
50 | */ |
51 | public String getCompartmentName() { |
52 | return Messages.InternalActionInfrastructureCallsCompartmentEditPart_title; |
53 | } |
54 | |
55 | /** |
56 | * @generated |
57 | */ |
58 | public IFigure createFigure() { |
59 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
60 | .createFigure(); |
61 | result.setTitleVisibility(false); |
62 | return result; |
63 | } |
64 | |
65 | /** |
66 | * @generated |
67 | */ |
68 | protected void createDefaultEditPolicies() { |
69 | super.createDefaultEditPolicies(); |
70 | installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, |
71 | new ResizableCompartmentEditPolicy()); |
72 | installEditPolicy( |
73 | EditPolicyRoles.SEMANTIC_ROLE, |
74 | new InternalActionInfrastructureCallsCompartmentItemSemanticEditPolicy()); |
75 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
76 | new CreationEditPolicy()); |
77 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
78 | new DragDropEditPolicy()); |
79 | installEditPolicy( |
80 | EditPolicyRoles.CANONICAL_ROLE, |
81 | new InternalActionInfrastructureCallsCompartmentCanonicalEditPolicy()); |
82 | } |
83 | |
84 | /** |
85 | * @generated |
86 | */ |
87 | protected void setRatio(Double ratio) { |
88 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
89 | super.setRatio(ratio); |
90 | } |
91 | } |
92 | |
93 | } |