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