KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > CounterColumnTypeItemProvider


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package Olj.provider;
8
9
10 import Olj.CounterColumnType;
11 import Olj.OljPackage;
12
13 import java.util.Collection JavaDoc;
14 import java.util.List JavaDoc;
15
16 import org.eclipse.emf.common.notify.AdapterFactory;
17 import org.eclipse.emf.common.notify.Notification;
18
19 import org.eclipse.emf.common.util.ResourceLocator;
20
21 import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
22 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
23 import org.eclipse.emf.edit.provider.IItemLabelProvider;
24 import org.eclipse.emf.edit.provider.IItemPropertySource;
25 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
26 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
27 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
28 import org.eclipse.emf.edit.provider.ItemProviderAdapter;
29 import org.eclipse.emf.edit.provider.ViewerNotification;
30
31 /**
32  * This is the item provider adpater for a {@link Olj.CounterColumnType} object.
33  * <!-- begin-user-doc -->
34  * <!-- end-user-doc -->
35  * @generated
36  */

37 public class CounterColumnTypeItemProvider
38     extends ItemProviderAdapter
39     implements
40         IEditingDomainItemProvider,
41         IStructuredItemContentProvider,
42         ITreeItemContentProvider,
43         IItemLabelProvider,
44         IItemPropertySource {
45     /**
46      * This constructs an instance from a factory and a notifier.
47      * <!-- begin-user-doc -->
48      * <!-- end-user-doc -->
49      * @generated
50      */

51     public CounterColumnTypeItemProvider(AdapterFactory adapterFactory) {
52         super(adapterFactory);
53     }
54
55     /**
56      * This returns the property descriptors for the adapted class.
57      * <!-- begin-user-doc -->
58      * <!-- end-user-doc -->
59      * @generated
60      */

61     public List JavaDoc getPropertyDescriptors(Object JavaDoc object) {
62         if (itemPropertyDescriptors == null) {
63             super.getPropertyDescriptors(object);
64
65             addCounterIncrementPropertyDescriptor(object);
66             addCounterNamePropertyDescriptor(object);
67             addCounterStartValuePropertyDescriptor(object);
68             addCounterStartValueResetPropertyDescriptor(object);
69             addTargetColumnNamePropertyDescriptor(object);
70             addTargetTableIDPropertyDescriptor(object);
71             addTargetTableNamePropertyDescriptor(object);
72             addValueModePropertyDescriptor(object);
73         }
74         return itemPropertyDescriptors;
75     }
76
77     /**
78      * This adds a property descriptor for the Counter Increment feature.
79      * <!-- begin-user-doc -->
80      * <!-- end-user-doc -->
81      * @generated
82      */

83     protected void addCounterIncrementPropertyDescriptor(Object JavaDoc object) {
84         itemPropertyDescriptors.add
85             (new ItemPropertyDescriptor
86                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
87                  getResourceLocator(),
88                  getString("_UI_CounterColumnType_counterIncrement_feature"),
89                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_counterIncrement_feature", "_UI_CounterColumnType_type"),
90                  OljPackage.eINSTANCE.getCounterColumnType_CounterIncrement(),
91                  true,
92                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
93     }
94
95     /**
96      * This adds a property descriptor for the Counter Name feature.
97      * <!-- begin-user-doc -->
98      * <!-- end-user-doc -->
99      * @generated
100      */

101     protected void addCounterNamePropertyDescriptor(Object JavaDoc object) {
102         itemPropertyDescriptors.add
103             (new ItemPropertyDescriptor
104                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
105                  getResourceLocator(),
106                  getString("_UI_CounterColumnType_counterName_feature"),
107                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_counterName_feature", "_UI_CounterColumnType_type"),
108                  OljPackage.eINSTANCE.getCounterColumnType_CounterName(),
109                  true,
110                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
111     }
112
113     /**
114      * This adds a property descriptor for the Counter Start Value feature.
115      * <!-- begin-user-doc -->
116      * <!-- end-user-doc -->
117      * @generated
118      */

119     protected void addCounterStartValuePropertyDescriptor(Object JavaDoc object) {
120         itemPropertyDescriptors.add
121             (new ItemPropertyDescriptor
122                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
123                  getResourceLocator(),
124                  getString("_UI_CounterColumnType_counterStartValue_feature"),
125                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_counterStartValue_feature", "_UI_CounterColumnType_type"),
126                  OljPackage.eINSTANCE.getCounterColumnType_CounterStartValue(),
127                  true,
128                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
129     }
130
131     /**
132      * This adds a property descriptor for the Counter Start Value Reset feature.
133      * <!-- begin-user-doc -->
134      * <!-- end-user-doc -->
135      * @generated
136      */

137     protected void addCounterStartValueResetPropertyDescriptor(Object JavaDoc object) {
138         itemPropertyDescriptors.add
139             (new ItemPropertyDescriptor
140                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
141                  getResourceLocator(),
142                  getString("_UI_CounterColumnType_counterStartValueReset_feature"),
143                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_counterStartValueReset_feature", "_UI_CounterColumnType_type"),
144                  OljPackage.eINSTANCE.getCounterColumnType_CounterStartValueReset(),
145                  true,
146                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
147     }
148
149     /**
150      * This adds a property descriptor for the Target Column Name feature.
151      * <!-- begin-user-doc -->
152      * <!-- end-user-doc -->
153      * @generated
154      */

155     protected void addTargetColumnNamePropertyDescriptor(Object JavaDoc object) {
156         itemPropertyDescriptors.add
157             (new ItemPropertyDescriptor
158                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
159                  getResourceLocator(),
160                  getString("_UI_CounterColumnType_targetColumnName_feature"),
161                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_targetColumnName_feature", "_UI_CounterColumnType_type"),
162                  OljPackage.eINSTANCE.getCounterColumnType_TargetColumnName(),
163                  true,
164                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
165     }
166
167     /**
168      * This adds a property descriptor for the Target Table ID feature.
169      * <!-- begin-user-doc -->
170      * <!-- end-user-doc -->
171      * @generated
172      */

173     protected void addTargetTableIDPropertyDescriptor(Object JavaDoc object) {
174         itemPropertyDescriptors.add
175             (new ItemPropertyDescriptor
176                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
177                  getResourceLocator(),
178                  getString("_UI_CounterColumnType_targetTableID_feature"),
179                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_targetTableID_feature", "_UI_CounterColumnType_type"),
180                  OljPackage.eINSTANCE.getCounterColumnType_TargetTableID(),
181                  true,
182                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
183     }
184
185     /**
186      * This adds a property descriptor for the Target Table Name feature.
187      * <!-- begin-user-doc -->
188      * <!-- end-user-doc -->
189      * @generated
190      */

191     protected void addTargetTableNamePropertyDescriptor(Object JavaDoc object) {
192         itemPropertyDescriptors.add
193             (new ItemPropertyDescriptor
194                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
195                  getResourceLocator(),
196                  getString("_UI_CounterColumnType_targetTableName_feature"),
197                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_targetTableName_feature", "_UI_CounterColumnType_type"),
198                  OljPackage.eINSTANCE.getCounterColumnType_TargetTableName(),
199                  true,
200                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
201     }
202
203     /**
204      * This adds a property descriptor for the Value Mode feature.
205      * <!-- begin-user-doc -->
206      * <!-- end-user-doc -->
207      * @generated
208      */

209     protected void addValueModePropertyDescriptor(Object JavaDoc object) {
210         itemPropertyDescriptors.add
211             (new ItemPropertyDescriptor
212                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
213                  getResourceLocator(),
214                  getString("_UI_CounterColumnType_valueMode_feature"),
215                  getString("_UI_PropertyDescriptor_description", "_UI_CounterColumnType_valueMode_feature", "_UI_CounterColumnType_type"),
216                  OljPackage.eINSTANCE.getCounterColumnType_ValueMode(),
217                  true,
218                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
219     }
220
221     /**
222      * This returns CounterColumnType.gif.
223      * <!-- begin-user-doc -->
224      * <!-- end-user-doc -->
225      * @generated
226      */

227     public Object JavaDoc getImage(Object JavaDoc object) {
228         return getResourceLocator().getImage("full/obj16/CounterColumnType");
229     }
230
231     /**
232      * This returns the label text for the adapted class.
233      * <!-- begin-user-doc -->
234      * <!-- end-user-doc -->
235      * @generated
236      */

237     public String JavaDoc getText(Object JavaDoc object) {
238         String JavaDoc label = ((CounterColumnType)object).getCounterName();
239         return label == null || label.length() == 0 ?
240             getString("_UI_CounterColumnType_type") :
241             getString("_UI_CounterColumnType_type") + " " + label;
242     }
243
244     /**
245      * This handles model notifications by calling {@link #updateChildren} to update any cached
246      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
247      * <!-- begin-user-doc -->
248      * <!-- end-user-doc -->
249      * @generated
250      */

251     public void notifyChanged(Notification notification) {
252         updateChildren(notification);
253
254         switch (notification.getFeatureID(CounterColumnType.class)) {
255             case OljPackage.COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
256             case OljPackage.COUNTER_COLUMN_TYPE__COUNTER_NAME:
257             case OljPackage.COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
258             case OljPackage.COUNTER_COLUMN_TYPE__COUNTER_START_VALUE_RESET:
259             case OljPackage.COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
260             case OljPackage.COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
261             case OljPackage.COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
262             case OljPackage.COUNTER_COLUMN_TYPE__VALUE_MODE:
263                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
264                 return;
265         }
266         super.notifyChanged(notification);
267     }
268
269     /**
270      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
271      * describing all of the children that can be created under this object.
272      * <!-- begin-user-doc -->
273      * <!-- end-user-doc -->
274      * @generated
275      */

276     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
277         super.collectNewChildDescriptors(newChildDescriptors, object);
278     }
279
280     /**
281      * Return the resource locator for this item provider's resources.
282      * <!-- begin-user-doc -->
283      * <!-- end-user-doc -->
284      * @generated
285      */

286     public ResourceLocator getResourceLocator() {
287         return OljEditPlugin.INSTANCE;
288     }
289
290 }
291
Popular Tags