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.DiscreteProcessingRateDegree; |
11 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
12 | |
13 | import java.util.Collection; |
14 | import java.util.List; |
15 | |
16 | import org.eclipse.emf.common.notify.AdapterFactory; |
17 | import org.eclipse.emf.common.notify.Notification; |
18 | |
19 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
20 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
21 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
22 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
23 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
24 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
25 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
26 | import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; |
27 | import org.eclipse.emf.edit.provider.ViewerNotification; |
28 | |
29 | /** |
30 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.designdecision.DiscreteProcessingRateDegree} object. |
31 | * <!-- begin-user-doc --> |
32 | * <!-- end-user-doc --> |
33 | * @generated |
34 | */ |
35 | public class DiscreteProcessingRateDegreeItemProvider |
36 | extends DiscreteRangeDegreeItemProvider |
37 | implements |
38 | IEditingDomainItemProvider, |
39 | IStructuredItemContentProvider, |
40 | ITreeItemContentProvider, |
41 | IItemLabelProvider, |
42 | IItemPropertySource { |
43 | /** |
44 | * This constructs an instance from a factory and a notifier. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @generated |
48 | */ |
49 | public DiscreteProcessingRateDegreeItemProvider(AdapterFactory adapterFactory) { |
50 | super(adapterFactory); |
51 | } |
52 | |
53 | /** |
54 | * This returns the property descriptors for the adapted class. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | @Override |
60 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
61 | if (itemPropertyDescriptors == null) { |
62 | super.getPropertyDescriptors(object); |
63 | |
64 | addProcessingresourcetypePropertyDescriptor(object); |
65 | addNumberOfStepsPropertyDescriptor(object); |
66 | } |
67 | return itemPropertyDescriptors; |
68 | } |
69 | |
70 | /** |
71 | * This adds a property descriptor for the Processingresourcetype feature. |
72 | * <!-- begin-user-doc --> |
73 | * <!-- end-user-doc --> |
74 | * @generated |
75 | */ |
76 | protected void addProcessingresourcetypePropertyDescriptor(Object object) { |
77 | itemPropertyDescriptors.add |
78 | (createItemPropertyDescriptor |
79 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
80 | getResourceLocator(), |
81 | getString("_UI_ProcessingResourceDegree_processingresourcetype_feature"), |
82 | getString("_UI_PropertyDescriptor_description", "_UI_ProcessingResourceDegree_processingresourcetype_feature", "_UI_ProcessingResourceDegree_type"), |
83 | designdecisionPackage.Literals.PROCESSING_RESOURCE_DEGREE__PROCESSINGRESOURCETYPE, |
84 | true, |
85 | false, |
86 | true, |
87 | null, |
88 | null, |
89 | null)); |
90 | } |
91 | |
92 | /** |
93 | * This adds a property descriptor for the Number Of Steps feature. |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | protected void addNumberOfStepsPropertyDescriptor(Object object) { |
99 | itemPropertyDescriptors.add |
100 | (createItemPropertyDescriptor |
101 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
102 | getResourceLocator(), |
103 | getString("_UI_DiscreteProcessingRateDegree_numberOfSteps_feature"), |
104 | getString("_UI_PropertyDescriptor_description", "_UI_DiscreteProcessingRateDegree_numberOfSteps_feature", "_UI_DiscreteProcessingRateDegree_type"), |
105 | designdecisionPackage.Literals.DISCRETE_PROCESSING_RATE_DEGREE__NUMBER_OF_STEPS, |
106 | true, |
107 | false, |
108 | false, |
109 | ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, |
110 | null, |
111 | null)); |
112 | } |
113 | |
114 | /** |
115 | * This returns DiscreteProcessingRateDegree.gif. |
116 | * <!-- begin-user-doc --> |
117 | * <!-- end-user-doc --> |
118 | * @generated |
119 | */ |
120 | @Override |
121 | public Object getImage(Object object) { |
122 | return overlayImage(object, getResourceLocator().getImage("full/obj16/DiscreteProcessingRateDegree")); |
123 | } |
124 | |
125 | /** |
126 | * This returns the label text for the adapted class. |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | @Override |
132 | public String getText(Object object) { |
133 | DiscreteProcessingRateDegree discreteProcessingRateDegree = (DiscreteProcessingRateDegree)object; |
134 | return getString("_UI_DiscreteProcessingRateDegree_type") + " " + discreteProcessingRateDegree.isUpperBoundIncluded(); |
135 | } |
136 | |
137 | /** |
138 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
139 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
140 | * <!-- begin-user-doc --> |
141 | * <!-- end-user-doc --> |
142 | * @generated |
143 | */ |
144 | @Override |
145 | public void notifyChanged(Notification notification) { |
146 | updateChildren(notification); |
147 | |
148 | switch (notification.getFeatureID(DiscreteProcessingRateDegree.class)) { |
149 | case designdecisionPackage.DISCRETE_PROCESSING_RATE_DEGREE__NUMBER_OF_STEPS: |
150 | fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); |
151 | return; |
152 | } |
153 | super.notifyChanged(notification); |
154 | } |
155 | |
156 | /** |
157 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
158 | * that can be created under this object. |
159 | * <!-- begin-user-doc --> |
160 | * <!-- end-user-doc --> |
161 | * @generated |
162 | */ |
163 | @Override |
164 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
165 | super.collectNewChildDescriptors(newChildDescriptors, object); |
166 | } |
167 | |
168 | } |