KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > TimeStampColumnTypeItemProvider


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

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

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

80     protected void addNamePropertyDescriptor(Object JavaDoc object) {
81         itemPropertyDescriptors.add
82             (new ItemPropertyDescriptor
83                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
84                  getResourceLocator(),
85                  getString("_UI_TimeStampColumnType_name_feature"),
86                  getString("_UI_PropertyDescriptor_description", "_UI_TimeStampColumnType_name_feature", "_UI_TimeStampColumnType_type"),
87                  OljPackage.eINSTANCE.getTimeStampColumnType_Name(),
88                  true,
89                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
90     }
91
92     /**
93      * This adds a property descriptor for the Target Column Name feature.
94      * <!-- begin-user-doc -->
95      * <!-- end-user-doc -->
96      * @generated
97      */

98     protected void addTargetColumnNamePropertyDescriptor(Object JavaDoc object) {
99         itemPropertyDescriptors.add
100             (new ItemPropertyDescriptor
101                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
102                  getResourceLocator(),
103                  getString("_UI_TimeStampColumnType_targetColumnName_feature"),
104                  getString("_UI_PropertyDescriptor_description", "_UI_TimeStampColumnType_targetColumnName_feature", "_UI_TimeStampColumnType_type"),
105                  OljPackage.eINSTANCE.getTimeStampColumnType_TargetColumnName(),
106                  true,
107                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
108     }
109
110     /**
111      * This adds a property descriptor for the Target Table ID feature.
112      * <!-- begin-user-doc -->
113      * <!-- end-user-doc -->
114      * @generated
115      */

116     protected void addTargetTableIDPropertyDescriptor(Object JavaDoc object) {
117         itemPropertyDescriptors.add
118             (new ItemPropertyDescriptor
119                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
120                  getResourceLocator(),
121                  getString("_UI_TimeStampColumnType_targetTableID_feature"),
122                  getString("_UI_PropertyDescriptor_description", "_UI_TimeStampColumnType_targetTableID_feature", "_UI_TimeStampColumnType_type"),
123                  OljPackage.eINSTANCE.getTimeStampColumnType_TargetTableID(),
124                  true,
125                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
126     }
127
128     /**
129      * This adds a property descriptor for the Target Table Name feature.
130      * <!-- begin-user-doc -->
131      * <!-- end-user-doc -->
132      * @generated
133      */

134     protected void addTargetTableNamePropertyDescriptor(Object JavaDoc object) {
135         itemPropertyDescriptors.add
136             (new ItemPropertyDescriptor
137                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
138                  getResourceLocator(),
139                  getString("_UI_TimeStampColumnType_targetTableName_feature"),
140                  getString("_UI_PropertyDescriptor_description", "_UI_TimeStampColumnType_targetTableName_feature", "_UI_TimeStampColumnType_type"),
141                  OljPackage.eINSTANCE.getTimeStampColumnType_TargetTableName(),
142                  true,
143                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
144     }
145
146     /**
147      * This adds a property descriptor for the Value Mode feature.
148      * <!-- begin-user-doc -->
149      * <!-- end-user-doc -->
150      * @generated
151      */

152     protected void addValueModePropertyDescriptor(Object JavaDoc object) {
153         itemPropertyDescriptors.add
154             (new ItemPropertyDescriptor
155                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
156                  getResourceLocator(),
157                  getString("_UI_TimeStampColumnType_valueMode_feature"),
158                  getString("_UI_PropertyDescriptor_description", "_UI_TimeStampColumnType_valueMode_feature", "_UI_TimeStampColumnType_type"),
159                  OljPackage.eINSTANCE.getTimeStampColumnType_ValueMode(),
160                  true,
161                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
162     }
163
164     /**
165      * This returns TimeStampColumnType.gif.
166      * <!-- begin-user-doc -->
167      * <!-- end-user-doc -->
168      * @generated
169      */

170     public Object JavaDoc getImage(Object JavaDoc object) {
171         return getResourceLocator().getImage("full/obj16/TimeStampColumnType");
172     }
173
174     /**
175      * This returns the label text for the adapted class.
176      * <!-- begin-user-doc -->
177      * <!-- end-user-doc -->
178      * @generated
179      */

180     public String JavaDoc getText(Object JavaDoc object) {
181         String JavaDoc label = ((TimeStampColumnType)object).getName();
182         return label == null || label.length() == 0 ?
183             getString("_UI_TimeStampColumnType_type") :
184             getString("_UI_TimeStampColumnType_type") + " " + label;
185     }
186
187     /**
188      * This handles model notifications by calling {@link #updateChildren} to update any cached
189      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
190      * <!-- begin-user-doc -->
191      * <!-- end-user-doc -->
192      * @generated
193      */

194     public void notifyChanged(Notification notification) {
195         updateChildren(notification);
196
197         switch (notification.getFeatureID(TimeStampColumnType.class)) {
198             case OljPackage.TIME_STAMP_COLUMN_TYPE__NAME:
199             case OljPackage.TIME_STAMP_COLUMN_TYPE__TARGET_COLUMN_NAME:
200             case OljPackage.TIME_STAMP_COLUMN_TYPE__TARGET_TABLE_ID:
201             case OljPackage.TIME_STAMP_COLUMN_TYPE__TARGET_TABLE_NAME:
202             case OljPackage.TIME_STAMP_COLUMN_TYPE__VALUE_MODE:
203                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
204                 return;
205         }
206         super.notifyChanged(notification);
207     }
208
209     /**
210      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
211      * describing all of the children that can be created under this object.
212      * <!-- begin-user-doc -->
213      * <!-- end-user-doc -->
214      * @generated
215      */

216     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
217         super.collectNewChildDescriptors(newChildDescriptors, object);
218     }
219
220     /**
221      * Return the resource locator for this item provider's resources.
222      * <!-- begin-user-doc -->
223      * <!-- end-user-doc -->
224      * @generated
225      */

226     public ResourceLocator getResourceLocator() {
227         return OljEditPlugin.INSTANCE;
228     }
229
230 }
231
Popular Tags