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.OperationInterfaceSignatureListCanonicalEditPolicy; |
19 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.OperationInterfaceSignatureListItemSemanticEditPolicy; |
20 | import de.uka.ipd.sdq.pcm.gmf.repository.part.Messages; |
21 | |
22 | /** |
23 | * @generated |
24 | */ |
25 | public class OperationInterfaceSignatureListEditPart extends |
26 | ListCompartmentEditPart { |
27 | |
28 | /** |
29 | * @generated |
30 | */ |
31 | public static final int VISUAL_ID = 7106; |
32 | |
33 | /** |
34 | * @generated |
35 | */ |
36 | public OperationInterfaceSignatureListEditPart(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.OperationInterfaceSignatureListEditPart_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(EditPolicyRoles.SEMANTIC_ROLE, |
72 | new OperationInterfaceSignatureListItemSemanticEditPolicy()); |
73 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
74 | new CreationEditPolicy()); |
75 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
76 | new DragDropEditPolicy()); |
77 | installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, |
78 | new OperationInterfaceSignatureListCanonicalEditPolicy()); |
79 | } |
80 | |
81 | /** |
82 | * @generated |
83 | */ |
84 | protected void setRatio(Double ratio) { |
85 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
86 | super.setRatio(ratio); |
87 | } |
88 | } |
89 | |
90 | } |