KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > ValueColumnTypeItemProvider


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

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

37 public class ValueColumnTypeItemProvider
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 ValueColumnTypeItemProvider(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             addDefaultValuePropertyDescriptor(object);
66             addFromHexPropertyDescriptor(object);
67             addSourceColumnNamePropertyDescriptor(object);
68             addTargetColumnNamePropertyDescriptor(object);
69             addTargetTableIDPropertyDescriptor(object);
70             addTargetTableNamePropertyDescriptor(object);
71             addToHexPropertyDescriptor(object);
72             addValueModePropertyDescriptor(object);
73         }
74         return itemPropertyDescriptors;
75     }
76
77     /**
78      * This adds a property descriptor for the Default Value feature.
79      * <!-- begin-user-doc -->
80      * <!-- end-user-doc -->
81      * @generated
82      */

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

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

119     protected void addSourceColumnNamePropertyDescriptor(Object JavaDoc object) {
120         itemPropertyDescriptors.add
121             (new ItemPropertyDescriptor
122                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
123                  getResourceLocator(),
124                  getString("_UI_ValueColumnType_sourceColumnName_feature"),
125                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_sourceColumnName_feature", "_UI_ValueColumnType_type"),
126                  OljPackage.eINSTANCE.getValueColumnType_SourceColumnName(),
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_ValueColumnType_targetColumnName_feature"),
143                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_targetColumnName_feature", "_UI_ValueColumnType_type"),
144                  OljPackage.eINSTANCE.getValueColumnType_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_ValueColumnType_targetTableID_feature"),
161                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_targetTableID_feature", "_UI_ValueColumnType_type"),
162                  OljPackage.eINSTANCE.getValueColumnType_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_ValueColumnType_targetTableName_feature"),
179                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_targetTableName_feature", "_UI_ValueColumnType_type"),
180                  OljPackage.eINSTANCE.getValueColumnType_TargetTableName(),
181                  true,
182                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
183     }
184
185     /**
186      * This adds a property descriptor for the To Hex feature.
187      * <!-- begin-user-doc -->
188      * <!-- end-user-doc -->
189      * @generated
190      */

191     protected void addToHexPropertyDescriptor(Object JavaDoc object) {
192         itemPropertyDescriptors.add
193             (new ItemPropertyDescriptor
194                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
195                  getResourceLocator(),
196                  getString("_UI_ValueColumnType_toHex_feature"),
197                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_toHex_feature", "_UI_ValueColumnType_type"),
198                  OljPackage.eINSTANCE.getValueColumnType_ToHex(),
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_ValueColumnType_valueMode_feature"),
215                  getString("_UI_PropertyDescriptor_description", "_UI_ValueColumnType_valueMode_feature", "_UI_ValueColumnType_type"),
216                  OljPackage.eINSTANCE.getValueColumnType_ValueMode(),
217                  true,
218                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
219     }
220
221     /**
222      * This returns ValueColumnType.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/ValueColumnType");
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 = ((ValueColumnType)object).getSourceColumnName();
239         return label == null || label.length() == 0 ?
240             getString("_UI_ValueColumnType_type") :
241             getString("_UI_ValueColumnType_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(ValueColumnType.class)) {
255             case OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE:
256             case OljPackage.VALUE_COLUMN_TYPE__FROM_HEX:
257             case OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME:
258             case OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME:
259             case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID:
260             case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME:
261             case OljPackage.VALUE_COLUMN_TYPE__TO_HEX:
262             case OljPackage.VALUE_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