1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.provider; |
8 | |
9 | import de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.util.QMLContractTypeAdapterFactory; |
10 | |
11 | import java.util.ArrayList; |
12 | import java.util.Collection; |
13 | |
14 | import org.eclipse.emf.common.notify.Adapter; |
15 | import org.eclipse.emf.common.notify.Notification; |
16 | import org.eclipse.emf.common.notify.Notifier; |
17 | |
18 | import org.eclipse.emf.edit.provider.ChangeNotifier; |
19 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
20 | import org.eclipse.emf.edit.provider.ComposedAdapterFactory; |
21 | import org.eclipse.emf.edit.provider.IChangeNotifier; |
22 | import org.eclipse.emf.edit.provider.IDisposable; |
23 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
24 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
25 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
26 | import org.eclipse.emf.edit.provider.INotifyChangedListener; |
27 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
28 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
29 | |
30 | /** |
31 | * This is the factory that is used to provide the interfaces needed to support Viewers. |
32 | * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. |
33 | * The adapters also support Eclipse property sheets. |
34 | * Note that most of the adapters are shared among multiple instances. |
35 | * <!-- begin-user-doc --> |
36 | * <!-- end-user-doc --> |
37 | * @generated |
38 | */ |
39 | public class QMLContractTypeItemProviderAdapterFactory extends QMLContractTypeAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { |
40 | /** |
41 | * This keeps track of the root adapter factory that delegates to this adapter factory. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @generated |
45 | */ |
46 | protected ComposedAdapterFactory parentAdapterFactory; |
47 | |
48 | /** |
49 | * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. |
50 | * <!-- begin-user-doc --> |
51 | * <!-- end-user-doc --> |
52 | * @generated |
53 | */ |
54 | protected IChangeNotifier changeNotifier = new ChangeNotifier(); |
55 | |
56 | /** |
57 | * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | protected Collection<Object> supportedTypes = new ArrayList<Object>(); |
63 | |
64 | /** |
65 | * This constructs an instance. |
66 | * <!-- begin-user-doc --> |
67 | * <!-- end-user-doc --> |
68 | * @generated |
69 | */ |
70 | public QMLContractTypeItemProviderAdapterFactory() { |
71 | supportedTypes.add(IEditingDomainItemProvider.class); |
72 | supportedTypes.add(IStructuredItemContentProvider.class); |
73 | supportedTypes.add(ITreeItemContentProvider.class); |
74 | supportedTypes.add(IItemLabelProvider.class); |
75 | supportedTypes.add(IItemPropertySource.class); |
76 | } |
77 | |
78 | /** |
79 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeSet} instances. |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | protected DimensionTypeSetItemProvider dimensionTypeSetItemProvider; |
85 | |
86 | /** |
87 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeSet}. |
88 | * <!-- begin-user-doc --> |
89 | * <!-- end-user-doc --> |
90 | * @generated |
91 | */ |
92 | @Override |
93 | public Adapter createDimensionTypeSetAdapter() { |
94 | if (dimensionTypeSetItemProvider == null) { |
95 | dimensionTypeSetItemProvider = new DimensionTypeSetItemProvider(this); |
96 | } |
97 | |
98 | return dimensionTypeSetItemProvider; |
99 | } |
100 | |
101 | /** |
102 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.RelationSemantics} instances. |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | protected RelationSemanticsItemProvider relationSemanticsItemProvider; |
108 | |
109 | /** |
110 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.RelationSemantics}. |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | @Override |
116 | public Adapter createRelationSemanticsAdapter() { |
117 | if (relationSemanticsItemProvider == null) { |
118 | relationSemanticsItemProvider = new RelationSemanticsItemProvider(this); |
119 | } |
120 | |
121 | return relationSemanticsItemProvider; |
122 | } |
123 | |
124 | /** |
125 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Element} instances. |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | protected ElementItemProvider elementItemProvider; |
131 | |
132 | /** |
133 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Element}. |
134 | * <!-- begin-user-doc --> |
135 | * <!-- end-user-doc --> |
136 | * @generated |
137 | */ |
138 | @Override |
139 | public Adapter createElementAdapter() { |
140 | if (elementItemProvider == null) { |
141 | elementItemProvider = new ElementItemProvider(this); |
142 | } |
143 | |
144 | return elementItemProvider; |
145 | } |
146 | |
147 | /** |
148 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Order} instances. |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @generated |
152 | */ |
153 | protected OrderItemProvider orderItemProvider; |
154 | |
155 | /** |
156 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Order}. |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @generated |
160 | */ |
161 | @Override |
162 | public Adapter createOrderAdapter() { |
163 | if (orderItemProvider == null) { |
164 | orderItemProvider = new OrderItemProvider(this); |
165 | } |
166 | |
167 | return orderItemProvider; |
168 | } |
169 | |
170 | /** |
171 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeEnum} instances. |
172 | * <!-- begin-user-doc --> |
173 | * <!-- end-user-doc --> |
174 | * @generated |
175 | */ |
176 | protected DimensionTypeEnumItemProvider dimensionTypeEnumItemProvider; |
177 | |
178 | /** |
179 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeEnum}. |
180 | * <!-- begin-user-doc --> |
181 | * <!-- end-user-doc --> |
182 | * @generated |
183 | */ |
184 | @Override |
185 | public Adapter createDimensionTypeEnumAdapter() { |
186 | if (dimensionTypeEnumItemProvider == null) { |
187 | dimensionTypeEnumItemProvider = new DimensionTypeEnumItemProvider(this); |
188 | } |
189 | |
190 | return dimensionTypeEnumItemProvider; |
191 | } |
192 | |
193 | /** |
194 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Unit} instances. |
195 | * <!-- begin-user-doc --> |
196 | * <!-- end-user-doc --> |
197 | * @generated |
198 | */ |
199 | protected UnitItemProvider unitItemProvider; |
200 | |
201 | /** |
202 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Unit}. |
203 | * <!-- begin-user-doc --> |
204 | * <!-- end-user-doc --> |
205 | * @generated |
206 | */ |
207 | @Override |
208 | public Adapter createUnitAdapter() { |
209 | if (unitItemProvider == null) { |
210 | unitItemProvider = new UnitItemProvider(this); |
211 | } |
212 | |
213 | return unitItemProvider; |
214 | } |
215 | |
216 | /** |
217 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeNumeric} instances. |
218 | * <!-- begin-user-doc --> |
219 | * <!-- end-user-doc --> |
220 | * @generated |
221 | */ |
222 | protected DimensionTypeNumericItemProvider dimensionTypeNumericItemProvider; |
223 | |
224 | /** |
225 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeNumeric}. |
226 | * <!-- begin-user-doc --> |
227 | * <!-- end-user-doc --> |
228 | * @generated |
229 | */ |
230 | @Override |
231 | public Adapter createDimensionTypeNumericAdapter() { |
232 | if (dimensionTypeNumericItemProvider == null) { |
233 | dimensionTypeNumericItemProvider = new DimensionTypeNumericItemProvider(this); |
234 | } |
235 | |
236 | return dimensionTypeNumericItemProvider; |
237 | } |
238 | |
239 | /** |
240 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.NumericRange} instances. |
241 | * <!-- begin-user-doc --> |
242 | * <!-- end-user-doc --> |
243 | * @generated |
244 | */ |
245 | protected NumericRangeItemProvider numericRangeItemProvider; |
246 | |
247 | /** |
248 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.NumericRange}. |
249 | * <!-- begin-user-doc --> |
250 | * <!-- end-user-doc --> |
251 | * @generated |
252 | */ |
253 | @Override |
254 | public Adapter createNumericRangeAdapter() { |
255 | if (numericRangeItemProvider == null) { |
256 | numericRangeItemProvider = new NumericRangeItemProvider(this); |
257 | } |
258 | |
259 | return numericRangeItemProvider; |
260 | } |
261 | |
262 | /** |
263 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.QMLContractType} instances. |
264 | * <!-- begin-user-doc --> |
265 | * <!-- end-user-doc --> |
266 | * @generated |
267 | */ |
268 | protected QMLContractTypeItemProvider qmlContractTypeItemProvider; |
269 | |
270 | /** |
271 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.QMLContractType}. |
272 | * <!-- begin-user-doc --> |
273 | * <!-- end-user-doc --> |
274 | * @generated |
275 | */ |
276 | @Override |
277 | public Adapter createQMLContractTypeAdapter() { |
278 | if (qmlContractTypeItemProvider == null) { |
279 | qmlContractTypeItemProvider = new QMLContractTypeItemProvider(this); |
280 | } |
281 | |
282 | return qmlContractTypeItemProvider; |
283 | } |
284 | |
285 | /** |
286 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.UnitRepository} instances. |
287 | * <!-- begin-user-doc --> |
288 | * <!-- end-user-doc --> |
289 | * @generated |
290 | */ |
291 | protected UnitRepositoryItemProvider unitRepositoryItemProvider; |
292 | |
293 | /** |
294 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.UnitRepository}. |
295 | * <!-- begin-user-doc --> |
296 | * <!-- end-user-doc --> |
297 | * @generated |
298 | */ |
299 | @Override |
300 | public Adapter createUnitRepositoryAdapter() { |
301 | if (unitRepositoryItemProvider == null) { |
302 | unitRepositoryItemProvider = new UnitRepositoryItemProvider(this); |
303 | } |
304 | |
305 | return unitRepositoryItemProvider; |
306 | } |
307 | |
308 | /** |
309 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeRepository} instances. |
310 | * <!-- begin-user-doc --> |
311 | * <!-- end-user-doc --> |
312 | * @generated |
313 | */ |
314 | protected DimensionTypeRepositoryItemProvider dimensionTypeRepositoryItemProvider; |
315 | |
316 | /** |
317 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionTypeRepository}. |
318 | * <!-- begin-user-doc --> |
319 | * <!-- end-user-doc --> |
320 | * @generated |
321 | */ |
322 | @Override |
323 | public Adapter createDimensionTypeRepositoryAdapter() { |
324 | if (dimensionTypeRepositoryItemProvider == null) { |
325 | dimensionTypeRepositoryItemProvider = new DimensionTypeRepositoryItemProvider(this); |
326 | } |
327 | |
328 | return dimensionTypeRepositoryItemProvider; |
329 | } |
330 | |
331 | /** |
332 | * This keeps track of the one adapter used for all {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Dimension} instances. |
333 | * <!-- begin-user-doc --> |
334 | * <!-- end-user-doc --> |
335 | * @generated |
336 | */ |
337 | protected DimensionItemProvider dimensionItemProvider; |
338 | |
339 | /** |
340 | * This creates an adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.Dimension}. |
341 | * <!-- begin-user-doc --> |
342 | * <!-- end-user-doc --> |
343 | * @generated |
344 | */ |
345 | @Override |
346 | public Adapter createDimensionAdapter() { |
347 | if (dimensionItemProvider == null) { |
348 | dimensionItemProvider = new DimensionItemProvider(this); |
349 | } |
350 | |
351 | return dimensionItemProvider; |
352 | } |
353 | |
354 | /** |
355 | * This returns the root adapter factory that contains this factory. |
356 | * <!-- begin-user-doc --> |
357 | * <!-- end-user-doc --> |
358 | * @generated |
359 | */ |
360 | public ComposeableAdapterFactory getRootAdapterFactory() { |
361 | return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); |
362 | } |
363 | |
364 | /** |
365 | * This sets the composed adapter factory that contains this factory. |
366 | * <!-- begin-user-doc --> |
367 | * <!-- end-user-doc --> |
368 | * @generated |
369 | */ |
370 | public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { |
371 | this.parentAdapterFactory = parentAdapterFactory; |
372 | } |
373 | |
374 | /** |
375 | * <!-- begin-user-doc --> |
376 | * <!-- end-user-doc --> |
377 | * @generated |
378 | */ |
379 | @Override |
380 | public boolean isFactoryForType(Object type) { |
381 | return supportedTypes.contains(type) || super.isFactoryForType(type); |
382 | } |
383 | |
384 | /** |
385 | * This implementation substitutes the factory itself as the key for the adapter. |
386 | * <!-- begin-user-doc --> |
387 | * <!-- end-user-doc --> |
388 | * @generated |
389 | */ |
390 | @Override |
391 | public Adapter adapt(Notifier notifier, Object type) { |
392 | return super.adapt(notifier, this); |
393 | } |
394 | |
395 | /** |
396 | * <!-- begin-user-doc --> |
397 | * <!-- end-user-doc --> |
398 | * @generated |
399 | */ |
400 | @Override |
401 | public Object adapt(Object object, Object type) { |
402 | if (isFactoryForType(type)) { |
403 | Object adapter = super.adapt(object, type); |
404 | if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) { |
405 | return adapter; |
406 | } |
407 | } |
408 | |
409 | return null; |
410 | } |
411 | |
412 | /** |
413 | * This adds a listener. |
414 | * <!-- begin-user-doc --> |
415 | * <!-- end-user-doc --> |
416 | * @generated |
417 | */ |
418 | public void addListener(INotifyChangedListener notifyChangedListener) { |
419 | changeNotifier.addListener(notifyChangedListener); |
420 | } |
421 | |
422 | /** |
423 | * This removes a listener. |
424 | * <!-- begin-user-doc --> |
425 | * <!-- end-user-doc --> |
426 | * @generated |
427 | */ |
428 | public void removeListener(INotifyChangedListener notifyChangedListener) { |
429 | changeNotifier.removeListener(notifyChangedListener); |
430 | } |
431 | |
432 | /** |
433 | * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. |
434 | * <!-- begin-user-doc --> |
435 | * <!-- end-user-doc --> |
436 | * @generated |
437 | */ |
438 | public void fireNotifyChanged(Notification notification) { |
439 | changeNotifier.fireNotifyChanged(notification); |
440 | |
441 | if (parentAdapterFactory != null) { |
442 | parentAdapterFactory.fireNotifyChanged(notification); |
443 | } |
444 | } |
445 | |
446 | /** |
447 | * This disposes all of the item providers created by this factory. |
448 | * <!-- begin-user-doc --> |
449 | * <!-- end-user-doc --> |
450 | * @generated |
451 | */ |
452 | public void dispose() { |
453 | if (dimensionTypeSetItemProvider != null) dimensionTypeSetItemProvider.dispose(); |
454 | if (relationSemanticsItemProvider != null) relationSemanticsItemProvider.dispose(); |
455 | if (elementItemProvider != null) elementItemProvider.dispose(); |
456 | if (orderItemProvider != null) orderItemProvider.dispose(); |
457 | if (dimensionTypeEnumItemProvider != null) dimensionTypeEnumItemProvider.dispose(); |
458 | if (unitItemProvider != null) unitItemProvider.dispose(); |
459 | if (dimensionTypeNumericItemProvider != null) dimensionTypeNumericItemProvider.dispose(); |
460 | if (numericRangeItemProvider != null) numericRangeItemProvider.dispose(); |
461 | if (qmlContractTypeItemProvider != null) qmlContractTypeItemProvider.dispose(); |
462 | if (unitRepositoryItemProvider != null) unitRepositoryItemProvider.dispose(); |
463 | if (dimensionTypeRepositoryItemProvider != null) dimensionTypeRepositoryItemProvider.dispose(); |
464 | if (dimensionItemProvider != null) dimensionItemProvider.dispose(); |
465 | } |
466 | |
467 | } |