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.ForkedBehaviourBehaviourCompartmentCanonicalEditPolicy; |
16 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ForkedBehaviourBehaviourCompartmentItemSemanticEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class ForkedBehaviourBehaviourCompartmentEditPart extends |
23 | ShapeCompartmentEditPart { |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public static final int VISUAL_ID = 7026; |
29 | |
30 | /** |
31 | * @generated |
32 | */ |
33 | public ForkedBehaviourBehaviourCompartmentEditPart(View view) { |
34 | super(view); |
35 | } |
36 | |
37 | /** |
38 | * @generated |
39 | */ |
40 | public String getCompartmentName() { |
41 | return Messages.ForkedBehaviourBehaviourCompartmentEditPart_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(EditPolicyRoles.SEMANTIC_ROLE, |
60 | new ForkedBehaviourBehaviourCompartmentItemSemanticEditPolicy()); |
61 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
62 | new CreationEditPolicy()); |
63 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
64 | new DragDropEditPolicy()); |
65 | installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, |
66 | new ForkedBehaviourBehaviourCompartmentCanonicalEditPolicy()); |
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 | } |