1 | /* |
2 | *Copyright 2007, SDQ, IPD, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.usage.edit.policies; |
5 | |
6 | import java.util.LinkedList; |
7 | import java.util.List; |
8 | |
9 | import org.eclipse.emf.ecore.EObject; |
10 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; |
11 | import org.eclipse.gmf.runtime.notation.View; |
12 | |
13 | import de.uka.ipd.sdq.pcm.gmf.usage.edit.parts.ScenarioBehaviour2EditPart; |
14 | import de.uka.ipd.sdq.pcm.gmf.usage.part.PalladioComponentModelVisualIDRegistry; |
15 | import de.uka.ipd.sdq.pcm.usagemodel.Loop; |
16 | |
17 | /** |
18 | * @generated |
19 | */ |
20 | public class LoopLoopCompartmentCanonicalEditPolicy extends CanonicalEditPolicy { |
21 | |
22 | /** |
23 | * @generated |
24 | */ |
25 | protected List getSemanticChildrenList() { |
26 | List result = new LinkedList(); |
27 | EObject modelObject = ((View) getHost().getModel()).getElement(); |
28 | View viewObject = (View) getHost().getModel(); |
29 | EObject nextValue; |
30 | int nodeVID; |
31 | nextValue = ((Loop) modelObject).getBodyBehaviour_Loop(); |
32 | nodeVID = PalladioComponentModelVisualIDRegistry.getNodeVisualID( |
33 | viewObject, nextValue); |
34 | if (ScenarioBehaviour2EditPart.VISUAL_ID == nodeVID) { |
35 | result.add(nextValue); |
36 | } |
37 | return result; |
38 | } |
39 | |
40 | /** |
41 | * @generated |
42 | */ |
43 | protected boolean shouldDeleteView(View view) { |
44 | return view.isSetElement() && view.getElement() != null |
45 | && view.getElement().eIsProxy(); |
46 | } |
47 | |
48 | /** |
49 | * @generated |
50 | */ |
51 | protected String getDefaultFactoryHint() { |
52 | return null; |
53 | } |
54 | |
55 | } |