KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > CopyTableTypeItemProvider


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

7 package Olj.provider;
8
9
10 import Olj.CopyTableType;
11 import Olj.OljFactory;
12 import Olj.OljPackage;
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.CopyTableType} object.
34  * <!-- begin-user-doc -->
35  * <!-- end-user-doc -->
36  * @generated
37  */

38 public class CopyTableTypeItemProvider
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 CopyTableTypeItemProvider(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             addCommitCountPropertyDescriptor(object);
67             addLogModePropertyDescriptor(object);
68             addNamePropertyDescriptor(object);
69             addObjectIDIncrementPropertyDescriptor(object);
70             addOidLogicPropertyDescriptor(object);
71             addOnErrorContinuePropertyDescriptor(object);
72             addSetCursorNamePropertyDescriptor(object);
73             addSetFetchSizePropertyDescriptor(object);
74             addSourceTableNamePropertyDescriptor(object);
75             addTargetTableNamePropertyDescriptor(object);
76         }
77         return itemPropertyDescriptors;
78     }
79
80     /**
81      * This adds a property descriptor for the Commit Count feature.
82      * <!-- begin-user-doc -->
83      * <!-- end-user-doc -->
84      * @generated
85      */

86     protected void addCommitCountPropertyDescriptor(Object JavaDoc object) {
87         itemPropertyDescriptors.add
88             (new ItemPropertyDescriptor
89                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
90                  getResourceLocator(),
91                  getString("_UI_CopyTableType_commitCount_feature"),
92                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_commitCount_feature", "_UI_CopyTableType_type"),
93                  OljPackage.eINSTANCE.getCopyTableType_CommitCount(),
94                  true,
95                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
96     }
97
98     /**
99      * This adds a property descriptor for the Log Mode feature.
100      * <!-- begin-user-doc -->
101      * <!-- end-user-doc -->
102      * @generated
103      */

104     protected void addLogModePropertyDescriptor(Object JavaDoc object) {
105         itemPropertyDescriptors.add
106             (new ItemPropertyDescriptor
107                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
108                  getResourceLocator(),
109                  getString("_UI_CopyTableType_logMode_feature"),
110                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_logMode_feature", "_UI_CopyTableType_type"),
111                  OljPackage.eINSTANCE.getCopyTableType_LogMode(),
112                  true,
113                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
114     }
115
116     /**
117      * This adds a property descriptor for the Name feature.
118      * <!-- begin-user-doc -->
119      * <!-- end-user-doc -->
120      * @generated
121      */

122     protected void addNamePropertyDescriptor(Object JavaDoc object) {
123         itemPropertyDescriptors.add
124             (new ItemPropertyDescriptor
125                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
126                  getResourceLocator(),
127                  getString("_UI_CopyTableType_name_feature"),
128                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_name_feature", "_UI_CopyTableType_type"),
129                  OljPackage.eINSTANCE.getCopyTableType_Name(),
130                  true,
131                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
132     }
133
134     /**
135      * This adds a property descriptor for the Object ID Increment feature.
136      * <!-- begin-user-doc -->
137      * <!-- end-user-doc -->
138      * @generated
139      */

140     protected void addObjectIDIncrementPropertyDescriptor(Object JavaDoc object) {
141         itemPropertyDescriptors.add
142             (new ItemPropertyDescriptor
143                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
144                  getResourceLocator(),
145                  getString("_UI_CopyTableType_objectIDIncrement_feature"),
146                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_objectIDIncrement_feature", "_UI_CopyTableType_type"),
147                  OljPackage.eINSTANCE.getCopyTableType_ObjectIDIncrement(),
148                  true,
149                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
150     }
151
152     /**
153      * This adds a property descriptor for the Oid Logic feature.
154      * <!-- begin-user-doc -->
155      * <!-- end-user-doc -->
156      * @generated
157      */

158     protected void addOidLogicPropertyDescriptor(Object JavaDoc object) {
159         itemPropertyDescriptors.add
160             (new ItemPropertyDescriptor
161                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
162                  getResourceLocator(),
163                  getString("_UI_CopyTableType_oidLogic_feature"),
164                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_oidLogic_feature", "_UI_CopyTableType_type"),
165                  OljPackage.eINSTANCE.getCopyTableType_OidLogic(),
166                  true,
167                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
168     }
169
170     /**
171      * This adds a property descriptor for the On Error Continue feature.
172      * <!-- begin-user-doc -->
173      * <!-- end-user-doc -->
174      * @generated
175      */

176     protected void addOnErrorContinuePropertyDescriptor(Object JavaDoc object) {
177         itemPropertyDescriptors.add
178             (new ItemPropertyDescriptor
179                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
180                  getResourceLocator(),
181                  getString("_UI_CopyTableType_onErrorContinue_feature"),
182                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_onErrorContinue_feature", "_UI_CopyTableType_type"),
183                  OljPackage.eINSTANCE.getCopyTableType_OnErrorContinue(),
184                  true,
185                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
186     }
187
188     /**
189      * This adds a property descriptor for the Set Cursor Name feature.
190      * <!-- begin-user-doc -->
191      * <!-- end-user-doc -->
192      * @generated
193      */

194     protected void addSetCursorNamePropertyDescriptor(Object JavaDoc object) {
195         itemPropertyDescriptors.add
196             (new ItemPropertyDescriptor
197                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
198                  getResourceLocator(),
199                  getString("_UI_CopyTableType_setCursorName_feature"),
200                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_setCursorName_feature", "_UI_CopyTableType_type"),
201                  OljPackage.eINSTANCE.getCopyTableType_SetCursorName(),
202                  true,
203                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
204     }
205
206     /**
207      * This adds a property descriptor for the Set Fetch Size feature.
208      * <!-- begin-user-doc -->
209      * <!-- end-user-doc -->
210      * @generated
211      */

212     protected void addSetFetchSizePropertyDescriptor(Object JavaDoc object) {
213         itemPropertyDescriptors.add
214             (new ItemPropertyDescriptor
215                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
216                  getResourceLocator(),
217                  getString("_UI_CopyTableType_setFetchSize_feature"),
218                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_setFetchSize_feature", "_UI_CopyTableType_type"),
219                  OljPackage.eINSTANCE.getCopyTableType_SetFetchSize(),
220                  true,
221                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
222     }
223
224     /**
225      * This adds a property descriptor for the Source Table Name feature.
226      * <!-- begin-user-doc -->
227      * <!-- end-user-doc -->
228      * @generated
229      */

230     protected void addSourceTableNamePropertyDescriptor(Object JavaDoc object) {
231         itemPropertyDescriptors.add
232             (new ItemPropertyDescriptor
233                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
234                  getResourceLocator(),
235                  getString("_UI_CopyTableType_sourceTableName_feature"),
236                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_sourceTableName_feature", "_UI_CopyTableType_type"),
237                  OljPackage.eINSTANCE.getCopyTableType_SourceTableName(),
238                  true,
239                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
240     }
241
242     /**
243      * This adds a property descriptor for the Target Table Name feature.
244      * <!-- begin-user-doc -->
245      * <!-- end-user-doc -->
246      * @generated
247      */

248     protected void addTargetTableNamePropertyDescriptor(Object JavaDoc object) {
249         itemPropertyDescriptors.add
250             (new ItemPropertyDescriptor
251                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
252                  getResourceLocator(),
253                  getString("_UI_CopyTableType_targetTableName_feature"),
254                  getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_targetTableName_feature", "_UI_CopyTableType_type"),
255                  OljPackage.eINSTANCE.getCopyTableType_TargetTableName(),
256                  true,
257                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
258     }
259
260     /**
261      * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
262      * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
263      * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
264      * <!-- begin-user-doc -->
265      * <!-- end-user-doc -->
266      * @generated
267      */

268     public Collection JavaDoc getChildrenFeatures(Object JavaDoc object) {
269         if (childrenFeatures == null) {
270             super.getChildrenFeatures(object);
271             childrenFeatures.add(OljPackage.eINSTANCE.getCopyTableType_JdbcParameters());
272         }
273         return childrenFeatures;
274     }
275
276     /**
277      * This returns CopyTableType.gif.
278      * <!-- begin-user-doc -->
279      * <!-- end-user-doc -->
280      * @generated
281      */

282     public Object JavaDoc getImage(Object JavaDoc object) {
283         return getResourceLocator().getImage("full/obj16/CopyTableType");
284     }
285
286     /**
287      * This returns the label text for the adapted class.
288      * <!-- begin-user-doc -->
289      * <!-- end-user-doc -->
290      * @generated
291      */

292     public String JavaDoc getText(Object JavaDoc object) {
293         String JavaDoc label = ((CopyTableType)object).getName();
294         return label == null || label.length() == 0 ?
295             getString("_UI_CopyTableType_type") :
296             getString("_UI_CopyTableType_type") + " " + label;
297     }
298
299     /**
300      * This handles model notifications by calling {@link #updateChildren} to update any cached
301      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
302      * <!-- begin-user-doc -->
303      * <!-- end-user-doc -->
304      * @generated
305      */

306     public void notifyChanged(Notification notification) {
307         updateChildren(notification);
308
309         switch (notification.getFeatureID(CopyTableType.class)) {
310             case OljPackage.COPY_TABLE_TYPE__COMMIT_COUNT:
311             case OljPackage.COPY_TABLE_TYPE__LOG_MODE:
312             case OljPackage.COPY_TABLE_TYPE__NAME:
313             case OljPackage.COPY_TABLE_TYPE__OBJECT_ID_INCREMENT:
314             case OljPackage.COPY_TABLE_TYPE__OID_LOGIC:
315             case OljPackage.COPY_TABLE_TYPE__ON_ERROR_CONTINUE:
316             case OljPackage.COPY_TABLE_TYPE__SET_CURSOR_NAME:
317             case OljPackage.COPY_TABLE_TYPE__SET_FETCH_SIZE:
318             case OljPackage.COPY_TABLE_TYPE__SOURCE_TABLE_NAME:
319             case OljPackage.COPY_TABLE_TYPE__TARGET_TABLE_NAME:
320                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
321                 return;
322             case OljPackage.COPY_TABLE_TYPE__JDBC_PARAMETERS:
323                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
324                 return;
325         }
326         super.notifyChanged(notification);
327     }
328
329     /**
330      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
331      * describing all of the children that can be created under this object.
332      * <!-- begin-user-doc -->
333      * <!-- end-user-doc -->
334      * @generated
335      */

336     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
337         super.collectNewChildDescriptors(newChildDescriptors, object);
338
339         newChildDescriptors.add
340             (createChildParameter
341                 (OljPackage.eINSTANCE.getCopyTableType_JdbcParameters(),
342                  OljFactory.eINSTANCE.createJdbcParametersType()));
343     }
344
345     /**
346      * Return the resource locator for this item provider's resources.
347      * <!-- begin-user-doc -->
348      * <!-- end-user-doc -->
349      * @generated
350      */

351     public ResourceLocator getResourceLocator() {
352         return OljEditPlugin.INSTANCE;
353     }
354
355 }
356
Popular Tags