1 | /* |
2 | *Copyright 2007, SDQ, IPD, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.usage.navigator; |
5 | |
6 | import org.eclipse.core.runtime.IAdapterFactory; |
7 | import org.eclipse.core.runtime.Platform; |
8 | import org.eclipse.emf.ecore.EObject; |
9 | import org.eclipse.emf.ecore.util.EcoreUtil; |
10 | import org.eclipse.gmf.runtime.notation.View; |
11 | |
12 | /** |
13 | * @generated |
14 | */ |
15 | public class PalladioComponentModelNavigatorItem extends |
16 | PalladioComponentModelAbstractNavigatorItem { |
17 | |
18 | /** |
19 | * @generated |
20 | */ |
21 | static { |
22 | final Class[] supportedTypes = new Class[] { View.class, EObject.class }; |
23 | Platform.getAdapterManager().registerAdapters( |
24 | new IAdapterFactory() { |
25 | |
26 | public Object getAdapter(Object adaptableObject, |
27 | Class adapterType) { |
28 | if (adaptableObject instanceof de.uka.ipd.sdq.pcm.gmf.usage.navigator.PalladioComponentModelNavigatorItem |
29 | && (adapterType == View.class || adapterType == EObject.class)) { |
30 | return ((de.uka.ipd.sdq.pcm.gmf.usage.navigator.PalladioComponentModelNavigatorItem) adaptableObject) |
31 | .getView(); |
32 | } |
33 | return null; |
34 | } |
35 | |
36 | public Class[] getAdapterList() { |
37 | return supportedTypes; |
38 | } |
39 | }, |
40 | de.uka.ipd.sdq.pcm.gmf.usage.navigator.PalladioComponentModelNavigatorItem.class); |
41 | } |
42 | |
43 | /** |
44 | * @generated |
45 | */ |
46 | private View myView; |
47 | |
48 | /** |
49 | * @generated |
50 | */ |
51 | private boolean myLeaf = false; |
52 | |
53 | /** |
54 | * @generated |
55 | */ |
56 | public PalladioComponentModelNavigatorItem(View view, Object parent, |
57 | boolean isLeaf) { |
58 | super(parent); |
59 | myView = view; |
60 | myLeaf = isLeaf; |
61 | } |
62 | |
63 | /** |
64 | * @generated |
65 | */ |
66 | public View getView() { |
67 | return myView; |
68 | } |
69 | |
70 | /** |
71 | * @generated |
72 | */ |
73 | public boolean isLeaf() { |
74 | return myLeaf; |
75 | } |
76 | |
77 | /** |
78 | * @generated |
79 | */ |
80 | public boolean equals(Object obj) { |
81 | if (obj instanceof de.uka.ipd.sdq.pcm.gmf.usage.navigator.PalladioComponentModelNavigatorItem) { |
82 | return EcoreUtil |
83 | .getURI(getView()) |
84 | .equals( |
85 | EcoreUtil |
86 | .getURI(((de.uka.ipd.sdq.pcm.gmf.usage.navigator.PalladioComponentModelNavigatorItem) obj) |
87 | .getView())); |
88 | } |
89 | return super.equals(obj); |
90 | } |
91 | |
92 | /** |
93 | * @generated |
94 | */ |
95 | public int hashCode() { |
96 | return EcoreUtil.getURI(getView()).hashCode(); |
97 | } |
98 | |
99 | } |