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