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.emf.common.notify.Notification; |
7 | import org.eclipse.gef.EditPolicy; |
8 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
9 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
11 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
12 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; |
13 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
14 | import org.eclipse.gmf.runtime.notation.View; |
15 | |
16 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.SetVariableActionVariableSetter2CanonicalEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.SetVariableActionVariableSetter2ItemSemanticEditPolicy; |
18 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
19 | |
20 | /** |
21 | * @generated |
22 | */ |
23 | public class SetVariableActionVariableSetter2EditPart extends |
24 | ListCompartmentEditPart { |
25 | |
26 | /** |
27 | * @generated |
28 | */ |
29 | public static final int VISUAL_ID = 7016; |
30 | |
31 | /** |
32 | * @generated |
33 | */ |
34 | public SetVariableActionVariableSetter2EditPart(View view) { |
35 | super(view); |
36 | } |
37 | |
38 | /** |
39 | * @generated |
40 | */ |
41 | protected boolean hasModelChildrenChanged(Notification evt) { |
42 | return false; |
43 | } |
44 | |
45 | /** |
46 | * @generated |
47 | */ |
48 | public String getCompartmentName() { |
49 | return Messages.SetVariableActionVariableSetter2EditPart_title; |
50 | } |
51 | |
52 | /** |
53 | * @generated |
54 | */ |
55 | protected void createDefaultEditPolicies() { |
56 | super.createDefaultEditPolicies(); |
57 | installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, |
58 | new ResizableCompartmentEditPolicy()); |
59 | installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, |
60 | new SetVariableActionVariableSetter2ItemSemanticEditPolicy()); |
61 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
62 | new CreationEditPolicy()); |
63 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
64 | new DragDropEditPolicy()); |
65 | installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, |
66 | new SetVariableActionVariableSetter2CanonicalEditPolicy()); |
67 | } |
68 | |
69 | /** |
70 | * @generated |
71 | */ |
72 | protected void setRatio(Double ratio) { |
73 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
74 | super.setRatio(ratio); |
75 | } |
76 | } |
77 | |
78 | } |