1 | /* |
2 | *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.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.core.composition.AssemblyContext; |
12 | import de.uka.ipd.sdq.pcm.core.composition.ComposedStructure; |
13 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
14 | import de.uka.ipd.sdq.pcm.core.composition.ProvidedDelegationConnector; |
15 | import de.uka.ipd.sdq.pcm.repository.OperationProvidedRole; |
16 | |
17 | /** |
18 | * @generated |
19 | */ |
20 | public class ProvidedDelegationConnectorTypeLinkCreateCommand extends |
21 | CreateRelationshipCommand { |
22 | |
23 | /** |
24 | * @generated |
25 | */ |
26 | private ComposedStructure myContainer; |
27 | |
28 | /** |
29 | * @generated |
30 | */ |
31 | private OperationProvidedRole mySource; |
32 | |
33 | /** |
34 | * @generated |
35 | */ |
36 | private OperationProvidedRole myTarget; |
37 | |
38 | /** |
39 | * @generated |
40 | */ |
41 | public ProvidedDelegationConnectorTypeLinkCreateCommand( |
42 | CreateRelationshipRequest req, ComposedStructure container, |
43 | OperationProvidedRole source, OperationProvidedRole target) { |
44 | super(req); |
45 | super.setElementToEdit(container); |
46 | myContainer = container; |
47 | mySource = source; |
48 | myTarget = target; |
49 | } |
50 | |
51 | /** |
52 | * @generated |
53 | */ |
54 | public ComposedStructure getContainer() { |
55 | return myContainer; |
56 | } |
57 | |
58 | /** |
59 | * @generated |
60 | */ |
61 | public EObject getSource() { |
62 | return mySource; |
63 | } |
64 | |
65 | /** |
66 | * @generated |
67 | */ |
68 | public EObject getTarget() { |
69 | return myTarget; |
70 | } |
71 | |
72 | /** |
73 | * @generated |
74 | */ |
75 | protected EClass getEClassToEdit() { |
76 | return CompositionPackage.eINSTANCE.getComposedStructure(); |
77 | } |
78 | |
79 | /** |
80 | * @generated |
81 | */ |
82 | protected void setElementToEdit(EObject element) { |
83 | throw new UnsupportedOperationException(); |
84 | } |
85 | |
86 | /** |
87 | * @generated not |
88 | */ |
89 | protected EObject doDefaultElementCreation() { |
90 | ProvidedDelegationConnector newElement = (ProvidedDelegationConnector) super |
91 | .doDefaultElementCreation(); |
92 | if (newElement != null) { |
93 | newElement |
94 | .setInnerProvidedRole_ProvidedDelegationConnector(myTarget); |
95 | newElement |
96 | .setOuterProvidedRole_ProvidedDelegationConnector(mySource); |
97 | CreateRelationshipRequest req = (CreateRelationshipRequest) this.getRequest(); |
98 | newElement.setAssemblyContext_ProvidedDelegationConnector((AssemblyContext) req.getParameter("CHILD_CONTEXT")); |
99 | } |
100 | return newElement; |
101 | } |
102 | |
103 | } |