1 | package de.uka.ipd.sdq.pcmbench.ui.provider.categoryaware; |
2 | |
3 | |
4 | import org.eclipse.emf.common.notify.AdapterFactory; |
5 | import org.eclipse.emf.edit.provider.DecoratorAdapterFactory; |
6 | import org.eclipse.emf.edit.provider.IChangeNotifier; |
7 | import org.eclipse.emf.edit.provider.IItemProviderDecorator; |
8 | |
9 | /** |
10 | * @author Snowball |
11 | * An adapter factory which creates ItemProviders which are able to display their |
12 | * model objects using categories. The categories are passed to the factory in order to |
13 | * configure it. |
14 | */ |
15 | public class CategoryAwareItemProviderAdapterFactory |
16 | extends DecoratorAdapterFactory |
17 | implements AdapterFactory, |
18 | IChangeNotifier { |
19 | |
20 | private ICategoryDescriptions categories; |
21 | |
22 | public CategoryAwareItemProviderAdapterFactory(AdapterFactory decoratedAdapterFactory, ICategoryDescriptions categories) { |
23 | super(decoratedAdapterFactory); |
24 | this.categories = categories; |
25 | } |
26 | |
27 | @Override |
28 | protected IItemProviderDecorator createItemProviderDecorator(Object target, Object Type) { |
29 | return new CategoryAwareItemProvider(this, categories); |
30 | } |
31 | |
32 | } |