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.Iterator; |
7 | import java.util.LinkedList; |
8 | import java.util.List; |
9 | |
10 | import org.eclipse.emf.ecore.EObject; |
11 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; |
12 | import org.eclipse.gmf.runtime.notation.View; |
13 | |
14 | import de.uka.ipd.sdq.pcm.gmf.usage.edit.parts.BranchTransitionEditPart; |
15 | import de.uka.ipd.sdq.pcm.gmf.usage.part.PalladioComponentModelVisualIDRegistry; |
16 | import de.uka.ipd.sdq.pcm.usagemodel.Branch; |
17 | |
18 | /** |
19 | * @generated |
20 | */ |
21 | public class BranchBranchCompartmentCanonicalEditPolicy extends |
22 | CanonicalEditPolicy { |
23 | |
24 | /** |
25 | * @generated |
26 | */ |
27 | protected List getSemanticChildrenList() { |
28 | List result = new LinkedList(); |
29 | EObject modelObject = ((View) getHost().getModel()).getElement(); |
30 | View viewObject = (View) getHost().getModel(); |
31 | EObject nextValue; |
32 | int nodeVID; |
33 | for (Iterator values = ((Branch) modelObject) |
34 | .getBranchTransitions_Branch().iterator(); values.hasNext();) { |
35 | nextValue = (EObject) values.next(); |
36 | nodeVID = PalladioComponentModelVisualIDRegistry.getNodeVisualID( |
37 | viewObject, nextValue); |
38 | if (BranchTransitionEditPart.VISUAL_ID == nodeVID) { |
39 | result.add(nextValue); |
40 | } |
41 | } |
42 | return result; |
43 | } |
44 | |
45 | /** |
46 | * @generated |
47 | */ |
48 | protected boolean shouldDeleteView(View view) { |
49 | return view.isSetElement() && view.getElement() != null |
50 | && view.getElement().eIsProxy(); |
51 | } |
52 | |
53 | /** |
54 | * @generated |
55 | */ |
56 | protected String getDefaultFactoryHint() { |
57 | return null; |
58 | } |
59 | |
60 | } |