1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcmbench.ui.provider; |
5 | |
6 | import org.eclipse.emf.common.notify.AdapterFactory; |
7 | import org.eclipse.emf.common.notify.Notification; |
8 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
9 | import org.eclipse.emf.edit.provider.DecoratorAdapterFactory; |
10 | import org.eclipse.emf.edit.provider.IItemProviderDecorator; |
11 | import org.eclipse.emf.edit.provider.INotifyChangedListener; |
12 | |
13 | |
14 | /** |
15 | * @author Snowball |
16 | * This factory generates the default ItemProvider adapter which can be used |
17 | * to display elements in Palladio related GUI elements, e.g., trees or list boxes |
18 | * |
19 | */ |
20 | public class PalladioItemProviderAdapterFactory |
21 | extends DecoratorAdapterFactory |
22 | implements INotifyChangedListener, ComposeableAdapterFactory |
23 | { |
24 | |
25 | /** |
26 | * @param decoratedAdapterFactory The factory which gets decorated |
27 | */ |
28 | public PalladioItemProviderAdapterFactory( |
29 | AdapterFactory decoratedAdapterFactory) { |
30 | super(decoratedAdapterFactory); |
31 | } |
32 | |
33 | /* (non-Javadoc) |
34 | * @see org.eclipse.emf.edit.provider.DecoratorAdapterFactory#createItemProviderDecorator(java.lang.Object, java.lang.Object) |
35 | */ |
36 | @Override |
37 | protected IItemProviderDecorator createItemProviderDecorator(Object target, |
38 | Object Type) { |
39 | PalladioItemProvider result = new PalladioItemProvider(this); |
40 | if (((Class)Type).isInstance(result)) { |
41 | result.addListener(this); |
42 | return result; |
43 | } |
44 | return null; |
45 | } |
46 | |
47 | public void notifyChanged(Notification notification) { |
48 | fireNotifyChanged(notification); |
49 | } |
50 | |
51 | /* (non-Javadoc) |
52 | * @see org.eclipse.emf.edit.provider.DecoratorAdapterFactory#getRootAdapterFactory() |
53 | */ |
54 | @Override |
55 | public ComposeableAdapterFactory getRootAdapterFactory() { |
56 | return this; |
57 | } |
58 | |
59 | } |