1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.qosannotations.provider; |
7 | |
8 | |
9 | import java.util.Collection; |
10 | import java.util.List; |
11 | |
12 | import org.eclipse.emf.common.notify.AdapterFactory; |
13 | import org.eclipse.emf.common.notify.Notification; |
14 | import org.eclipse.emf.common.util.ResourceLocator; |
15 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
16 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
17 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
18 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
19 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
20 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
21 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
22 | import org.eclipse.emf.edit.provider.ItemProviderAdapter; |
23 | |
24 | import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin; |
25 | import de.uka.ipd.sdq.pcm.qosannotations.QosannotationsPackage; |
26 | |
27 | /** |
28 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.qosannotations.SpecifiedQoSAnnotation} object. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public class SpecifiedQoSAnnotationItemProvider |
34 | extends ItemProviderAdapter |
35 | implements |
36 | IEditingDomainItemProvider, |
37 | IStructuredItemContentProvider, |
38 | ITreeItemContentProvider, |
39 | IItemLabelProvider, |
40 | IItemPropertySource { |
41 | /** |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @generated |
45 | */ |
46 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
47 | |
48 | /** |
49 | * This constructs an instance from a factory and a notifier. |
50 | * <!-- begin-user-doc --> |
51 | * <!-- end-user-doc --> |
52 | * @generated |
53 | */ |
54 | public SpecifiedQoSAnnotationItemProvider(AdapterFactory adapterFactory) { |
55 | super(adapterFactory); |
56 | } |
57 | |
58 | /** |
59 | * This returns the property descriptors for the adapted class. |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
66 | if (itemPropertyDescriptors == null) { |
67 | super.getPropertyDescriptors(object); |
68 | |
69 | addSignature_SpecifiedQoSAnnationPropertyDescriptor(object); |
70 | addRole_SpecifiedQoSAnnotationPropertyDescriptor(object); |
71 | } |
72 | return itemPropertyDescriptors; |
73 | } |
74 | |
75 | /** |
76 | * This adds a property descriptor for the Signature Specified Qo SAnnation feature. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | protected void addSignature_SpecifiedQoSAnnationPropertyDescriptor(Object object) { |
82 | itemPropertyDescriptors.add |
83 | (createItemPropertyDescriptor |
84 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
85 | getResourceLocator(), |
86 | getString("_UI_SpecifiedQoSAnnotation_signature_SpecifiedQoSAnnation_feature"), |
87 | getString("_UI_PropertyDescriptor_description", "_UI_SpecifiedQoSAnnotation_signature_SpecifiedQoSAnnation_feature", "_UI_SpecifiedQoSAnnotation_type"), |
88 | QosannotationsPackage.Literals.SPECIFIED_QO_SANNOTATION__SIGNATURE_SPECIFIED_QO_SANNATION, |
89 | true, |
90 | false, |
91 | true, |
92 | null, |
93 | null, |
94 | null)); |
95 | } |
96 | |
97 | /** |
98 | * This adds a property descriptor for the Role Specified Qo SAnnotation feature. |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | protected void addRole_SpecifiedQoSAnnotationPropertyDescriptor(Object object) { |
104 | itemPropertyDescriptors.add |
105 | (createItemPropertyDescriptor |
106 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
107 | getResourceLocator(), |
108 | getString("_UI_SpecifiedQoSAnnotation_role_SpecifiedQoSAnnotation_feature"), |
109 | getString("_UI_PropertyDescriptor_description", "_UI_SpecifiedQoSAnnotation_role_SpecifiedQoSAnnotation_feature", "_UI_SpecifiedQoSAnnotation_type"), |
110 | QosannotationsPackage.Literals.SPECIFIED_QO_SANNOTATION__ROLE_SPECIFIED_QO_SANNOTATION, |
111 | true, |
112 | false, |
113 | true, |
114 | null, |
115 | null, |
116 | null)); |
117 | } |
118 | |
119 | /** |
120 | * This returns the label text for the adapted class. |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | @Override |
126 | public String getText(Object object) { |
127 | return getString("_UI_SpecifiedQoSAnnotation_type"); |
128 | } |
129 | |
130 | /** |
131 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
132 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
133 | * <!-- begin-user-doc --> |
134 | * <!-- end-user-doc --> |
135 | * @generated |
136 | */ |
137 | @Override |
138 | public void notifyChanged(Notification notification) { |
139 | updateChildren(notification); |
140 | super.notifyChanged(notification); |
141 | } |
142 | |
143 | /** |
144 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
145 | * that can be created under this object. |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | @Override |
151 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
152 | super.collectNewChildDescriptors(newChildDescriptors, object); |
153 | } |
154 | |
155 | /** |
156 | * Return the resource locator for this item provider's resources. |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @generated |
160 | */ |
161 | @Override |
162 | public ResourceLocator getResourceLocator() { |
163 | return PalladioComponentModelEditPlugin.INSTANCE; |
164 | } |
165 | |
166 | } |