1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.provider; |
8 | |
9 | |
10 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
11 | import java.util.Collection; |
12 | import java.util.List; |
13 | |
14 | import org.eclipse.emf.common.notify.AdapterFactory; |
15 | import org.eclipse.emf.common.notify.Notification; |
16 | |
17 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
18 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
19 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
20 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
21 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
22 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
23 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.designdecision.EnumDegree} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class EnumDegreeItemProvider |
32 | extends UnorderedDegreeItemProvider |
33 | implements |
34 | IEditingDomainItemProvider, |
35 | IStructuredItemContentProvider, |
36 | ITreeItemContentProvider, |
37 | IItemLabelProvider, |
38 | IItemPropertySource { |
39 | /** |
40 | * This constructs an instance from a factory and a notifier. |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @generated |
44 | */ |
45 | public EnumDegreeItemProvider(AdapterFactory adapterFactory) { |
46 | super(adapterFactory); |
47 | } |
48 | |
49 | /** |
50 | * This returns the property descriptors for the adapted class. |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | @Override |
56 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
57 | if (itemPropertyDescriptors == null) { |
58 | super.getPropertyDescriptors(object); |
59 | |
60 | addEnumerationPropertyDescriptor(object); |
61 | } |
62 | return itemPropertyDescriptors; |
63 | } |
64 | |
65 | /** |
66 | * This adds a property descriptor for the Enumeration feature. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | protected void addEnumerationPropertyDescriptor(Object object) { |
72 | itemPropertyDescriptors.add |
73 | (createItemPropertyDescriptor |
74 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
75 | getResourceLocator(), |
76 | getString("_UI_EnumDegree_enumeration_feature"), |
77 | getString("_UI_PropertyDescriptor_description", "_UI_EnumDegree_enumeration_feature", "_UI_EnumDegree_type"), |
78 | designdecisionPackage.Literals.ENUM_DEGREE__ENUMERATION, |
79 | true, |
80 | false, |
81 | true, |
82 | null, |
83 | null, |
84 | null)); |
85 | } |
86 | |
87 | /** |
88 | * This returns EnumDegree.gif. |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | @Override |
94 | public Object getImage(Object object) { |
95 | return overlayImage(object, getResourceLocator().getImage("full/obj16/EnumDegree")); |
96 | } |
97 | |
98 | /** |
99 | * This returns the label text for the adapted class. |
100 | * <!-- begin-user-doc --> |
101 | * <!-- end-user-doc --> |
102 | * @generated |
103 | */ |
104 | @Override |
105 | public String getText(Object object) { |
106 | return getString("_UI_EnumDegree_type"); |
107 | } |
108 | |
109 | /** |
110 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
111 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
112 | * <!-- begin-user-doc --> |
113 | * <!-- end-user-doc --> |
114 | * @generated |
115 | */ |
116 | @Override |
117 | public void notifyChanged(Notification notification) { |
118 | updateChildren(notification); |
119 | super.notifyChanged(notification); |
120 | } |
121 | |
122 | /** |
123 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
124 | * that can be created under this object. |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | @Override |
130 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
131 | super.collectNewChildDescriptors(newChildDescriptors, object); |
132 | } |
133 | |
134 | } |