1 | /* |
2 | *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.edit.commands; |
5 | |
6 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
7 | |
8 | import org.eclipse.emf.ecore.EClass; |
9 | import org.eclipse.emf.ecore.EObject; |
10 | |
11 | import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; |
12 | |
13 | import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; |
14 | |
15 | import org.eclipse.gmf.runtime.notation.View; |
16 | |
17 | // TODO: decide whether this file is obsolete |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class RequiredRole2CreateCommand extends CreateElementCommand { |
23 | |
24 | /** |
25 | * @generated |
26 | */ |
27 | public RequiredRole2CreateCommand(CreateElementRequest req) { |
28 | super(req); |
29 | } |
30 | |
31 | /** |
32 | * @generated |
33 | */ |
34 | protected EClass getEClassToEdit() { |
35 | return EntityPackage.eINSTANCE.getInterfaceRequiringEntity(); |
36 | } |
37 | |
38 | /** |
39 | * @generated |
40 | */ |
41 | protected EObject getElementToEdit() { |
42 | EObject container = ((CreateElementRequest) getRequest()) |
43 | .getContainer(); |
44 | if (container instanceof View) { |
45 | container = ((View) container).getElement(); |
46 | } |
47 | return container; |
48 | } |
49 | |
50 | } |