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