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.emf.common.notify.Notification; |
7 | import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
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.draw2d.ui.figures.ConstrainedToolbarLayout; |
12 | import org.eclipse.gmf.runtime.notation.View; |
13 | |
14 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.BasicComponentPassiveResourceCompartmentCanonicalEditPolicy; |
15 | import de.uka.ipd.sdq.pcm.gmf.repository.edit.policies.BasicComponentPassiveResourceCompartmentItemSemanticEditPolicy; |
16 | import de.uka.ipd.sdq.pcm.gmf.repository.part.Messages; |
17 | |
18 | /** |
19 | * @generated |
20 | */ |
21 | public class BasicComponentPassiveResourceCompartmentEditPart extends |
22 | ListCompartmentEditPart { |
23 | |
24 | /** |
25 | * @generated |
26 | */ |
27 | public static final int VISUAL_ID = 7103; |
28 | |
29 | /** |
30 | * @generated |
31 | */ |
32 | public BasicComponentPassiveResourceCompartmentEditPart(View view) { |
33 | super(view); |
34 | } |
35 | |
36 | /** |
37 | * @generated |
38 | */ |
39 | protected boolean hasModelChildrenChanged(Notification evt) { |
40 | return false; |
41 | } |
42 | |
43 | /** |
44 | * @generated |
45 | */ |
46 | public String getCompartmentName() { |
47 | return Messages.BasicComponentPassiveResourceCompartmentEditPart_title; |
48 | } |
49 | |
50 | /** |
51 | * @generated |
52 | */ |
53 | protected void createDefaultEditPolicies() { |
54 | super.createDefaultEditPolicies(); |
55 | installEditPolicy( |
56 | EditPolicyRoles.SEMANTIC_ROLE, |
57 | new BasicComponentPassiveResourceCompartmentItemSemanticEditPolicy()); |
58 | installEditPolicy(EditPolicyRoles.CREATION_ROLE, |
59 | new CreationEditPolicy()); |
60 | installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, |
61 | new DragDropEditPolicy()); |
62 | installEditPolicy( |
63 | EditPolicyRoles.CANONICAL_ROLE, |
64 | new BasicComponentPassiveResourceCompartmentCanonicalEditPolicy()); |
65 | } |
66 | |
67 | /** |
68 | * @generated |
69 | */ |
70 | protected void setRatio(Double ratio) { |
71 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
72 | super.setRatio(ratio); |
73 | } |
74 | } |
75 | |
76 | } |