1 | /* |
2 | * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.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.composite.edit.policies.ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentCanonicalEditPolicy; |
16 | import de.uka.ipd.sdq.pcm.gmf.composite.edit.policies.ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentItemSemanticEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.composite.part.Messages; |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentEditPart |
23 | extends ShapeCompartmentEditPart { |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public static final int VISUAL_ID = 7002; |
29 | |
30 | /** |
31 | * @generated |
32 | */ |
33 | public ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentEditPart( |
34 | View view) { |
35 | super(view); |
36 | } |
37 | |
38 | /** |
39 | * @generated |
40 | */ |
41 | public String getCompartmentName() { |
42 | return Messages.ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentEditPart_title; |
43 | } |
44 | |
45 | /** |
46 | * @generated |
47 | */ |
48 | public IFigure createFigure() { |
49 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
50 | .createFigure(); |
51 | result.setTitleVisibility(false); |
52 | return result; |
53 | } |
54 | |
55 | /** |
56 | * @generated |
57 | */ |
58 | protected void createDefaultEditPolicies() { |
59 | super.createDefaultEditPolicies(); |
60 | installEditPolicy( |
61 | EditPolicyRoles.SEMANTIC_ROLE, |
62 | new ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentItemSemanticEditPolicy()); |
63 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
64 | new CreationEditPolicy()); |
65 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
66 | new DragDropEditPolicy()); |
67 | installEditPolicy( |
68 | EditPolicyRoles.CANONICAL_ROLE, |
69 | new ComposedProvidingRequiringEntityCompositeStructureInnerCompartmentCanonicalEditPolicy()); |
70 | } |
71 | |
72 | /** |
73 | * @generated |
74 | */ |
75 | protected void setRatio(Double ratio) { |
76 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
77 | super.setRatio(ratio); |
78 | } |
79 | } |
80 | |
81 | } |