KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > SubCounterColumnTypeItemProvider


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

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

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

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

62     public List JavaDoc getPropertyDescriptors(Object JavaDoc object) {
63         if (itemPropertyDescriptors == null) {
64             super.getPropertyDescriptors(object);
65
66             addCounterIncrementPropertyDescriptor(object);
67             addCounterNamePropertyDescriptor(object);
68             addCounterStartValuePropertyDescriptor(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_SubCounterColumnType_counterIncrement_feature"),
89                  getString("_UI_PropertyDescriptor_description", "_UI_SubCounterColumnType_counterIncrement_feature", "_UI_SubCounterColumnType_type"),
90                  OljPackage.eINSTANCE.getSubCounterColumnType_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_SubCounterColumnType_counterName_feature"),
107                  getString("_UI_PropertyDescriptor_description", "_UI_SubCounterColumnType_counterName_feature", "_UI_SubCounterColumnType_type"),
108                  OljPackage.eINSTANCE.getSubCounterColumnType_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_SubCounterColumnType_counterStartValue_feature"),
125                  getString("_UI_PropertyDescriptor_description", "_UI_SubCounterColumnType_counterStartValue_feature", "_UI_SubCounterColumnType_type"),
126                  OljPackage.eINSTANCE.getSubCounterColumnType_CounterStartValue(),
127                  true,
128                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
129     }
130
131     /**
132      * This adds a property descriptor for the Target Column Name feature.
133      * <!-- begin-user-doc -->
134      * <!-- end-user-doc -->
135      * @generated
136      */

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

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

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

191     protected void addValueModePropertyDescriptor(Object JavaDoc object) {
192         itemPropertyDescriptors.add
193             (new ItemPropertyDescriptor
194                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
195                  getResourceLocator(),
196                  getString("_UI_SubCounterColumnType_valueMode_feature"),
197                  getString("_UI_PropertyDescriptor_description", "_UI_SubCounterColumnType_valueMode_feature", "_UI_SubCounterColumnType_type"),
198                  OljPackage.eINSTANCE.getSubCounterColumnType_ValueMode(),
199                  true,
200                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
201     }
202
203     /**
204      * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
205      * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
206      * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
207      * <!-- begin-user-doc -->
208      * <!-- end-user-doc -->
209      * @generated
210      */

211     public Collection JavaDoc getChildrenFeatures(Object JavaDoc object) {
212         if (childrenFeatures == null) {
213             super.getChildrenFeatures(object);
214             childrenFeatures.add(OljPackage.eINSTANCE.getSubCounterColumnType_SubCounterKeyColumn());
215         }
216         return childrenFeatures;
217     }
218
219     /**
220      * This returns SubCounterColumnType.gif.
221      * <!-- begin-user-doc -->
222      * <!-- end-user-doc -->
223      * @generated
224      */

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

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

249     public void notifyChanged(Notification notification) {
250         updateChildren(notification);
251
252         switch (notification.getFeatureID(SubCounterColumnType.class)) {
253             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
254             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME:
255             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
256             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
257             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
258             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
259             case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE:
260                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
261                 return;
262             case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
263                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
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         newChildDescriptors.add
280             (createChildParameter
281                 (OljPackage.eINSTANCE.getSubCounterColumnType_SubCounterKeyColumn(),
282                  OljFactory.eINSTANCE.createSubCounterKeyColumnType()));
283     }
284
285     /**
286      * Return the resource locator for this item provider's resources.
287      * <!-- begin-user-doc -->
288      * <!-- end-user-doc -->
289      * @generated
290      */

291     public ResourceLocator getResourceLocator() {
292         return OljEditPlugin.INSTANCE;
293     }
294
295 }
296
Popular Tags