1 | package de.uka.ipd.sdq.pcm.gmf.seff.helper; |
2 | |
3 | import org.eclipse.emf.common.notify.AdapterFactory; |
4 | import org.eclipse.emf.edit.provider.DecoratorAdapterFactory; |
5 | import org.eclipse.emf.edit.provider.IChangeNotifier; |
6 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
7 | import org.eclipse.emf.edit.provider.IItemProviderDecorator; |
8 | |
9 | /** @author roman */ |
10 | public class CollectionIteratorItemProviderAdapterFactory extends |
11 | DecoratorAdapterFactory { |
12 | |
13 | public CollectionIteratorItemProviderAdapterFactory( |
14 | AdapterFactory decoratedAdapterFactory) { |
15 | super(decoratedAdapterFactory); |
16 | } |
17 | |
18 | /* (non-Javadoc) |
19 | * @see org.eclipse.emf.edit.provider.DecoratorAdapterFactory#createItemProviderDecorator(java.lang.Object, java.lang.Object) |
20 | */ |
21 | @Override |
22 | protected IItemProviderDecorator createItemProviderDecorator(Object target, |
23 | Object type) { |
24 | IItemProviderDecorator decorator = new CollectionIteratorLabelProvider(this); |
25 | if (type == IItemLabelProvider.class) { |
26 | decorator |
27 | .setDecoratedItemProvider((IChangeNotifier) decoratedAdapterFactory |
28 | .adapt(target, IItemLabelProvider.class)); |
29 | } else { |
30 | decorator |
31 | .setDecoratedItemProvider((IChangeNotifier) decoratedAdapterFactory |
32 | .adapt(target, type)); |
33 | } |
34 | return decorator; |
35 | } |
36 | } |