1 | package de.uka.ipd.sdq.pcmbench.ui.provider.categoryaware; |
2 | |
3 | |
4 | import org.eclipse.emf.ecore.EReference; |
5 | |
6 | /** |
7 | * @author Snowball |
8 | * A class used to configure a single category of the category aware item provider |
9 | */ |
10 | public class CategoryDescriptor { |
11 | private EReference eReference = null; |
12 | private String label; |
13 | private Class childClass; |
14 | private Class parentClass; |
15 | |
16 | /** |
17 | * See constructor for description |
18 | * @return the childClass |
19 | */ |
20 | public Class getChildClass() { |
21 | return childClass; |
22 | } |
23 | |
24 | /** |
25 | * See constructor for description |
26 | * @return the eReference |
27 | */ |
28 | public EReference getEReference() { |
29 | return eReference; |
30 | } |
31 | |
32 | /** |
33 | * See constructor for description |
34 | * @return the label |
35 | */ |
36 | public String getLabel() { |
37 | return label; |
38 | } |
39 | |
40 | /** |
41 | * See constructor for description |
42 | * @return the parentClass |
43 | */ |
44 | public Class getParentClass() { |
45 | return parentClass; |
46 | } |
47 | |
48 | /** |
49 | * @param parentClass Reflective class of the parent node of this category, e.g., Repository.class |
50 | * @param childClass Reflective class of the child nodes which should belong to this category, e.g., ProvidesComponentType.class |
51 | * This is used to filter the children accordingly |
52 | * @param eReference The eReference of the parent node which is searched to find matching children |
53 | * @param label The label which is displayed for the category |
54 | */ |
55 | public CategoryDescriptor(Class parentClass, // parent Object |
56 | Class childClass, // Class of the children of the category |
57 | EReference eReference, // eReference of the category |
58 | String label) // Label to display for the category |
59 | { |
60 | this.eReference = eReference; |
61 | this.label = label; |
62 | this.parentClass = parentClass; |
63 | this.childClass = childClass; |
64 | } |
65 | } |