1 | /* |
2 | * Copyright 2007, IPD, SDQ, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.repository.edit.parts; |
5 | |
6 | import org.eclipse.gef.EditPolicy; |
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.editpolicies.ResizableCompartmentEditPolicy; |
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.repository.edit.policies.BasicComponentComponentParameterCompartmentCanonicalEditPolicy; |
16 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.BasicComponentComponentParameterCompartmentItemSemanticEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.repository.part.Messages; |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class BasicComponentComponentParameterCompartmentEditPart extends |
23 | ShapeCompartmentEditPart { |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public static final int VISUAL_ID = 7104; |
29 | |
30 | /** |
31 | * @generated |
32 | */ |
33 | public BasicComponentComponentParameterCompartmentEditPart(View view) { |
34 | super(view); |
35 | } |
36 | |
37 | /** |
38 | * @generated |
39 | */ |
40 | public String getCompartmentName() { |
41 | return Messages.BasicComponentComponentParameterCompartmentEditPart_title; |
42 | } |
43 | |
44 | /** |
45 | * @generated |
46 | */ |
47 | protected void createDefaultEditPolicies() { |
48 | super.createDefaultEditPolicies(); |
49 | installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, |
50 | new ResizableCompartmentEditPolicy()); |
51 | installEditPolicy( |
52 | EditPolicyRoles.SEMANTIC_ROLE, |
53 | new BasicComponentComponentParameterCompartmentItemSemanticEditPolicy()); |
54 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
55 | new CreationEditPolicy()); |
56 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
57 | new DragDropEditPolicy()); |
58 | installEditPolicy( |
59 | EditPolicyRoles.CANONICAL_ROLE, |
60 | new BasicComponentComponentParameterCompartmentCanonicalEditPolicy()); |
61 | } |
62 | |
63 | /** |
64 | * @generated |
65 | */ |
66 | protected void setRatio(Double ratio) { |
67 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
68 | super.setRatio(ratio); |
69 | } |
70 | } |
71 | |
72 | } |