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.emf.common.notify.Notification; |
8 | import org.eclipse.gef.EditPolicy; |
9 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; |
11 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; |
12 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; |
13 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
14 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; |
15 | import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
16 | import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; |
17 | import org.eclipse.gmf.runtime.notation.View; |
18 | |
19 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.InfrastructureCallInfrastructureCallInputVariableUsagesCanonicalEditPolicy; |
20 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.InfrastructureCallInfrastructureCallInputVariableUsagesItemSemanticEditPolicy; |
21 | import de.uka.ipd.sdq.pcm.gmf.seff.part.Messages; |
22 | |
23 | /** |
24 | * @generated |
25 | */ |
26 | public class InfrastructureCallInfrastructureCallInputVariableUsagesEditPart |
27 | extends ListCompartmentEditPart { |
28 | |
29 | /** |
30 | * @generated |
31 | */ |
32 | public static final int VISUAL_ID = 7049; |
33 | |
34 | /** |
35 | * @generated |
36 | */ |
37 | public InfrastructureCallInfrastructureCallInputVariableUsagesEditPart( |
38 | View view) { |
39 | super(view); |
40 | } |
41 | |
42 | /** |
43 | * @generated |
44 | */ |
45 | protected boolean hasModelChildrenChanged(Notification evt) { |
46 | return false; |
47 | } |
48 | |
49 | /** |
50 | * @generated |
51 | */ |
52 | public String getCompartmentName() { |
53 | return Messages.InfrastructureCallInfrastructureCallInputVariableUsagesEditPart_title; |
54 | } |
55 | |
56 | /** |
57 | * @generated |
58 | */ |
59 | public IFigure createFigure() { |
60 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
61 | .createFigure(); |
62 | result.setTitleVisibility(false); |
63 | return result; |
64 | } |
65 | |
66 | /** |
67 | * @generated |
68 | */ |
69 | protected void createDefaultEditPolicies() { |
70 | super.createDefaultEditPolicies(); |
71 | installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, |
72 | new ResizableCompartmentEditPolicy()); |
73 | installEditPolicy( |
74 | EditPolicyRoles.SEMANTIC_ROLE, |
75 | new InfrastructureCallInfrastructureCallInputVariableUsagesItemSemanticEditPolicy()); |
76 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
77 | new CreationEditPolicy()); |
78 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
79 | new DragDropEditPolicy()); |
80 | installEditPolicy( |
81 | EditPolicyRoles.CANONICAL_ROLE, |
82 | new InfrastructureCallInfrastructureCallInputVariableUsagesCanonicalEditPolicy()); |
83 | } |
84 | |
85 | /** |
86 | * @generated |
87 | */ |
88 | protected void setRatio(Double ratio) { |
89 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
90 | super.setRatio(ratio); |
91 | } |
92 | } |
93 | |
94 | } |