1 | /* |
2 | * Copyright 2009, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.resource.part; |
5 | |
6 | import org.eclipse.core.runtime.IAdaptable; |
7 | import org.eclipse.emf.ecore.EObject; |
8 | import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; |
9 | import org.eclipse.gmf.runtime.emf.type.core.IElementType; |
10 | |
11 | /** |
12 | * @generated |
13 | */ |
14 | public class PalladioComponentModelLinkDescriptor extends |
15 | PalladioComponentModelNodeDescriptor { |
16 | |
17 | /** |
18 | * @generated |
19 | */ |
20 | private EObject mySource; |
21 | |
22 | /** |
23 | * @generated |
24 | */ |
25 | private EObject myDestination; |
26 | |
27 | /** |
28 | * @generated |
29 | */ |
30 | private IAdaptable mySemanticAdapter; |
31 | |
32 | /** |
33 | * @generated |
34 | */ |
35 | private PalladioComponentModelLinkDescriptor(EObject source, |
36 | EObject destination, EObject linkElement, int linkVID) { |
37 | super(linkElement, linkVID); |
38 | mySource = source; |
39 | myDestination = destination; |
40 | } |
41 | |
42 | /** |
43 | * @generated |
44 | */ |
45 | public PalladioComponentModelLinkDescriptor(EObject source, |
46 | EObject destination, IElementType elementType, int linkVID) { |
47 | this(source, destination, (EObject) null, linkVID); |
48 | final IElementType elementTypeCopy = elementType; |
49 | mySemanticAdapter = new IAdaptable() { |
50 | public Object getAdapter(Class adapter) { |
51 | if (IElementType.class.equals(adapter)) { |
52 | return elementTypeCopy; |
53 | } |
54 | return null; |
55 | } |
56 | }; |
57 | } |
58 | |
59 | /** |
60 | * @generated |
61 | */ |
62 | public PalladioComponentModelLinkDescriptor(EObject source, |
63 | EObject destination, EObject linkElement, IElementType elementType, |
64 | int linkVID) { |
65 | this(source, destination, linkElement, linkVID); |
66 | final IElementType elementTypeCopy = elementType; |
67 | mySemanticAdapter = new EObjectAdapter(linkElement) { |
68 | public Object getAdapter(Class adapter) { |
69 | if (IElementType.class.equals(adapter)) { |
70 | return elementTypeCopy; |
71 | } |
72 | return super.getAdapter(adapter); |
73 | } |
74 | }; |
75 | } |
76 | |
77 | /** |
78 | * @generated |
79 | */ |
80 | public EObject getSource() { |
81 | return mySource; |
82 | } |
83 | |
84 | /** |
85 | * @generated |
86 | */ |
87 | public EObject getDestination() { |
88 | return myDestination; |
89 | } |
90 | |
91 | /** |
92 | * @generated |
93 | */ |
94 | public IAdaptable getSemanticAdapter() { |
95 | return mySemanticAdapter; |
96 | } |
97 | |
98 | } |