1 | /* |
2 | * Copyright 2006 SDQ Research Group, University of Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.seff.edit.policies; |
5 | |
6 | import java.util.Collection; |
7 | import java.util.HashSet; |
8 | import java.util.Iterator; |
9 | import java.util.LinkedList; |
10 | import java.util.List; |
11 | import java.util.Set; |
12 | |
13 | import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; |
14 | import org.eclipse.gmf.runtime.notation.View; |
15 | |
16 | import de.uka.ipd.sdq.pcm.gmf.seff.edit.parts.RecoveryActionBehaviourEditPart; |
17 | import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelDiagramUpdater; |
18 | import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelNodeDescriptor; |
19 | import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelVisualIDRegistry; |
20 | |
21 | /** |
22 | * @generated |
23 | */ |
24 | public class RecoveryActionRecoveryBlockCompartment2CanonicalEditPolicy extends |
25 | CanonicalEditPolicy { |
26 | |
27 | /** |
28 | * @generated |
29 | */ |
30 | Set myFeaturesToSynchronize; |
31 | |
32 | /** |
33 | * @generated |
34 | */ |
35 | protected List getSemanticChildrenList() { |
36 | View viewObject = (View) getHost().getModel(); |
37 | List result = new LinkedList(); |
38 | for (Iterator it = PalladioComponentModelDiagramUpdater |
39 | .getRecoveryActionRecoveryBlockCompartment_7056SemanticChildren( |
40 | viewObject).iterator(); it.hasNext();) { |
41 | result.add(((PalladioComponentModelNodeDescriptor) it.next()) |
42 | .getModelElement()); |
43 | } |
44 | return result; |
45 | } |
46 | |
47 | /** |
48 | * @generated |
49 | */ |
50 | protected boolean isOrphaned(Collection semanticChildren, final View view) { |
51 | int visualID = PalladioComponentModelVisualIDRegistry.getVisualID(view); |
52 | switch (visualID) { |
53 | case RecoveryActionBehaviourEditPart.VISUAL_ID: |
54 | if (!semanticChildren.contains(view.getElement())) { |
55 | return true; |
56 | } |
57 | } |
58 | return false; |
59 | } |
60 | |
61 | /** |
62 | * @generated |
63 | */ |
64 | protected String getDefaultFactoryHint() { |
65 | return null; |
66 | } |
67 | |
68 | /** |
69 | * @generated |
70 | */ |
71 | protected Set getFeaturesToSynchronize() { |
72 | if (myFeaturesToSynchronize == null) { |
73 | myFeaturesToSynchronize = new HashSet(); |
74 | myFeaturesToSynchronize |
75 | .add(de.uka.ipd.sdq.pcm.seff.seff_reliability.Seff_reliabilityPackage.eINSTANCE |
76 | .getRecoveryAction_RecoveryActionBehaviours__RecoveryAction()); |
77 | } |
78 | return myFeaturesToSynchronize; |
79 | } |
80 | |
81 | } |