1 | /* |
2 | *Copyright 2007, SDQ, IPD, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.usage.edit.commands; |
5 | |
6 | import org.eclipse.emf.ecore.EClass; |
7 | import org.eclipse.emf.ecore.EObject; |
8 | import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand; |
9 | import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; |
10 | |
11 | import de.uka.ipd.sdq.pcm.usagemodel.AbstractUserAction; |
12 | import de.uka.ipd.sdq.pcm.usagemodel.ScenarioBehaviour; |
13 | import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage; |
14 | |
15 | /** |
16 | * @generated |
17 | */ |
18 | public class AbstractUserActionTypeLinkCreateCommand extends |
19 | CreateRelationshipCommand { |
20 | |
21 | /** |
22 | * @generated |
23 | */ |
24 | private ScenarioBehaviour mySource; |
25 | |
26 | /** |
27 | * @generated |
28 | */ |
29 | private AbstractUserAction myTarget; |
30 | |
31 | /** |
32 | * @generated |
33 | */ |
34 | public AbstractUserActionTypeLinkCreateCommand( |
35 | CreateRelationshipRequest req, ScenarioBehaviour source, |
36 | AbstractUserAction target) { |
37 | super(req); |
38 | super.setElementToEdit(source); |
39 | mySource = source; |
40 | myTarget = target; |
41 | } |
42 | |
43 | /** |
44 | * @generated |
45 | */ |
46 | public EObject getSource() { |
47 | return mySource; |
48 | } |
49 | |
50 | /** |
51 | * @generated |
52 | */ |
53 | public EObject getTarget() { |
54 | return myTarget; |
55 | } |
56 | |
57 | /** |
58 | * @generated |
59 | */ |
60 | protected EClass getEClassToEdit() { |
61 | return UsagemodelPackage.eINSTANCE.getScenarioBehaviour(); |
62 | } |
63 | |
64 | /** |
65 | * @generated |
66 | */ |
67 | protected void setElementToEdit(EObject element) { |
68 | throw new UnsupportedOperationException(); |
69 | } |
70 | |
71 | /** |
72 | * @generated |
73 | */ |
74 | protected EObject doDefaultElementCreation() { |
75 | AbstractUserAction newElement = (AbstractUserAction) super |
76 | .doDefaultElementCreation(); |
77 | if (newElement != null) { |
78 | newElement.setSuccessor(myTarget); |
79 | } |
80 | return newElement; |
81 | } |
82 | |
83 | } |