KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > TableTypeItemProvider


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

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

37 public class TableTypeItemProvider
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 TableTypeItemProvider(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             addAutoMapColumnsPropertyDescriptor(object);
66             addDefaultModePropertyDescriptor(object);
67             addInsertPropertyDescriptor(object);
68             addOidLogicPropertyDescriptor(object);
69             addTableIDPropertyDescriptor(object);
70             addTableModePropertyDescriptor(object);
71             addTableNamePropertyDescriptor(object);
72         }
73         return itemPropertyDescriptors;
74     }
75
76     /**
77      * This adds a property descriptor for the Auto Map Columns feature.
78      * <!-- begin-user-doc -->
79      * <!-- end-user-doc -->
80      * @generated
81      */

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

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

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

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

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

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

190     protected void addTableNamePropertyDescriptor(Object JavaDoc object) {
191         itemPropertyDescriptors.add
192             (new ItemPropertyDescriptor
193                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
194                  getResourceLocator(),
195                  getString("_UI_TableType_tableName_feature"),
196                  getString("_UI_PropertyDescriptor_description", "_UI_TableType_tableName_feature", "_UI_TableType_type"),
197                  OljPackage.eINSTANCE.getTableType_TableName(),
198                  true,
199                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
200     }
201
202     /**
203      * This returns TableType.gif.
204      * <!-- begin-user-doc -->
205      * <!-- end-user-doc -->
206      * @generated
207      */

208     public Object JavaDoc getImage(Object JavaDoc object) {
209         return getResourceLocator().getImage("full/obj16/TableType");
210     }
211
212     /**
213      * This returns the label text for the adapted class.
214      * <!-- begin-user-doc -->
215      * <!-- end-user-doc -->
216      * @generated
217      */

218     public String JavaDoc getText(Object JavaDoc object) {
219         String JavaDoc label = ((TableType)object).getTableName();
220         return label == null || label.length() == 0 ?
221             getString("_UI_TableType_type") :
222             getString("_UI_TableType_type") + " " + label;
223     }
224
225     /**
226      * This handles model notifications by calling {@link #updateChildren} to update any cached
227      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
228      * <!-- begin-user-doc -->
229      * <!-- end-user-doc -->
230      * @generated
231      */

232     public void notifyChanged(Notification notification) {
233         updateChildren(notification);
234
235         switch (notification.getFeatureID(TableType.class)) {
236             case OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS:
237             case OljPackage.TABLE_TYPE__DEFAULT_MODE:
238             case OljPackage.TABLE_TYPE__INSERT:
239             case OljPackage.TABLE_TYPE__OID_LOGIC:
240             case OljPackage.TABLE_TYPE__TABLE_ID:
241             case OljPackage.TABLE_TYPE__TABLE_MODE:
242             case OljPackage.TABLE_TYPE__TABLE_NAME:
243                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
244                 return;
245         }
246         super.notifyChanged(notification);
247     }
248
249     /**
250      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
251      * describing all of the children that can be created under this object.
252      * <!-- begin-user-doc -->
253      * <!-- end-user-doc -->
254      * @generated
255      */

256     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
257         super.collectNewChildDescriptors(newChildDescriptors, object);
258     }
259
260     /**
261      * Return the resource locator for this item provider's resources.
262      * <!-- begin-user-doc -->
263      * <!-- end-user-doc -->
264      * @generated
265      */

266     public ResourceLocator getResourceLocator() {
267         return OljEditPlugin.INSTANCE;
268     }
269
270 }
271
Popular Tags