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.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; |
8 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
9 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
11 | import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
12 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
13 | import org.eclipse.gmf.runtime.notation.View; |
14 | |
15 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ResourceDemandingBehaviourBehaviourCompartment2CanonicalEditPolicy; |
16 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ResourceDemandingBehaviourBehaviourCompartment2ItemSemanticEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class ResourceDemandingBehaviourBehaviourCompartment2EditPart extends |
23 | ShapeCompartmentEditPart { |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public static final int VISUAL_ID = 7009; |
29 | |
30 | /** |
31 | * @generated |
32 | */ |
33 | public ResourceDemandingBehaviourBehaviourCompartment2EditPart(View view) { |
34 | super(view); |
35 | } |
36 | |
37 | /** |
38 | * @generated |
39 | */ |
40 | public String getCompartmentName() { |
41 | return Messages.ResourceDemandingBehaviourBehaviourCompartment2EditPart_title; |
42 | } |
43 | |
44 | /** |
45 | * @generated |
46 | */ |
47 | public IFigure createFigure() { |
48 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
49 | .createFigure(); |
50 | result.setTitleVisibility(false); |
51 | return result; |
52 | } |
53 | |
54 | /** |
55 | * @generated |
56 | */ |
57 | protected void createDefaultEditPolicies() { |
58 | super.createDefaultEditPolicies(); |
59 | installEditPolicy( |
60 | EditPolicyRoles.SEMANTIC_ROLE, |
61 | new ResourceDemandingBehaviourBehaviourCompartment2ItemSemanticEditPolicy()); |
62 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
63 | new CreationEditPolicy()); |
64 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
65 | new DragDropEditPolicy()); |
66 | installEditPolicy( |
67 | EditPolicyRoles.CANONICAL_ROLE, |
68 | new ResourceDemandingBehaviourBehaviourCompartment2CanonicalEditPolicy()); |
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 | } |