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.draw2d.IFigure; |
7 | import org.eclipse.emf.common.notify.Notification; |
8 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
9 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
11 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
12 | import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
13 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
14 | import org.eclipse.gmf.runtime.notation.View; |
15 | |
16 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.VariableUsageComponentParameterVariableCharacterisationCompartmentCanonicalEditPolicy; |
17 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.VariableUsageComponentParameterVariableCharacterisationCompartmentItemSemanticEditPolicy; |
18 | import de.uka.ipd.sdq.pcm.gmf.repository.part.Messages; |
19 | |
20 | /** |
21 | * @generated |
22 | */ |
23 | public class VariableUsageComponentParameterVariableCharacterisationCompartmentEditPart |
24 | extends ListCompartmentEditPart { |
25 | |
26 | /** |
27 | * @generated |
28 | */ |
29 | public static final int VISUAL_ID = 7105; |
30 | |
31 | /** |
32 | * @generated |
33 | */ |
34 | public VariableUsageComponentParameterVariableCharacterisationCompartmentEditPart( |
35 | 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.VariableUsageComponentParameterVariableCharacterisationCompartmentEditPart_title; |
51 | } |
52 | |
53 | /** |
54 | * @generated |
55 | */ |
56 | public IFigure createFigure() { |
57 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
58 | .createFigure(); |
59 | result.setTitleVisibility(false); |
60 | return result; |
61 | } |
62 | |
63 | /** |
64 | * @generated |
65 | */ |
66 | protected void createDefaultEditPolicies() { |
67 | super.createDefaultEditPolicies(); |
68 | installEditPolicy( |
69 | EditPolicyRoles.SEMANTIC_ROLE, |
70 | new VariableUsageComponentParameterVariableCharacterisationCompartmentItemSemanticEditPolicy()); |
71 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
72 | new CreationEditPolicy()); |
73 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
74 | new DragDropEditPolicy()); |
75 | installEditPolicy( |
76 | EditPolicyRoles.CANONICAL_ROLE, |
77 | new VariableUsageComponentParameterVariableCharacterisationCompartmentCanonicalEditPolicy()); |
78 | } |
79 | |
80 | /** |
81 | * @generated |
82 | */ |
83 | protected void setRatio(Double ratio) { |
84 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
85 | super.setRatio(ratio); |
86 | } |
87 | } |
88 | |
89 | } |