1 | /* |
2 | * Copyright 2009, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.resource.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.EditPolicyRoles; |
10 | import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
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.resource.edit.policies.ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentItemSemanticEditPolicy; |
15 | import de.uka.ipd.sdq.pcm.gmf.resource.part.Messages; |
16 | |
17 | /** |
18 | * @generated |
19 | */ |
20 | public class ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentEditPart |
21 | extends ListCompartmentEditPart { |
22 | |
23 | /** |
24 | * @generated |
25 | */ |
26 | public static final int VISUAL_ID = 7002; |
27 | |
28 | /** |
29 | * @generated |
30 | */ |
31 | public ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentEditPart( |
32 | 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.ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentEditPart_title; |
48 | } |
49 | |
50 | /** |
51 | * @generated NOT |
52 | */ |
53 | public IFigure createFigure() { |
54 | ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
55 | .createFigure(); |
56 | result.setTitleVisibility(false); |
57 | result.setBorder(null); // custom code |
58 | return result; |
59 | } |
60 | |
61 | /** |
62 | * @generated |
63 | */ |
64 | protected void createDefaultEditPolicies() { |
65 | super.createDefaultEditPolicies(); |
66 | installEditPolicy( |
67 | EditPolicyRoles.SEMANTIC_ROLE, |
68 | new ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentItemSemanticEditPolicy()); |
69 | } |
70 | |
71 | /** |
72 | * @generated |
73 | */ |
74 | protected void setRatio(Double ratio) { |
75 | if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { |
76 | super.setRatio(ratio); |
77 | } |
78 | } |
79 | |
80 | } |