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.InternalActionInfrastructureCallsCompartment2CanonicalEditPolicy; |
20 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.InternalActionInfrastructureCallsCompartment2ItemSemanticEditPolicy; |
21 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
22 | |
23 | /** |
24 | * @generated |
25 | */ |
26 | public class InternalActionInfrastructureCallsCompartment2EditPart extends |
27 | ListCompartmentEditPart { |
28 | |
29 | /** |
30 | * @generated |
31 | */ |
32 | public static final int VISUAL_ID = 7051; |
33 | |
34 | /** |
35 | * @generated |
36 | */ |
37 | public InternalActionInfrastructureCallsCompartment2EditPart(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.InternalActionInfrastructureCallsCompartment2EditPart_title; |
53 | } |
54 | |
55 | /** |
56 | * @generated |
57 | */ |
58 | protected void createDefaultEditPolicies() { |
59 | super.createDefaultEditPolicies(); |
60 | installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, |
61 | new ResizableCompartmentEditPolicy()); |
62 | installEditPolicy( |
63 | EditPolicyRoles.SEMANTIC_ROLE, |
64 | new InternalActionInfrastructureCallsCompartment2ItemSemanticEditPolicy()); |
65 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
66 | new CreationEditPolicy()); |
67 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
68 | new DragDropEditPolicy()); |
69 | installEditPolicy( |
70 | EditPolicyRoles.CANONICAL_ROLE, |
71 | new InternalActionInfrastructureCallsCompartment2CanonicalEditPolicy()); |
72 | } |
73 | |
74 | /** |
75 | * @generated |
76 | */ |
77 | protected void setRatio(Double ratio) { |
78 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
79 | super.setRatio(ratio); |
80 | } |
81 | } |
82 | |
83 | } |