KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > VariableColumnTypeItemProvider


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

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

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

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

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

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

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

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

171     protected void addValueModePropertyDescriptor(Object JavaDoc object) {
172         itemPropertyDescriptors.add
173             (new ItemPropertyDescriptor
174                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
175                  getResourceLocator(),
176                  getString("_UI_VariableColumnType_valueMode_feature"),
177                  getString("_UI_PropertyDescriptor_description", "_UI_VariableColumnType_valueMode_feature", "_UI_VariableColumnType_type"),
178                  OljPackage.eINSTANCE.getVariableColumnType_ValueMode(),
179                  true,
180                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
181     }
182
183     /**
184      * This returns VariableColumnType.gif.
185      * <!-- begin-user-doc -->
186      * <!-- end-user-doc -->
187      * @generated
188      */

189     public Object JavaDoc getImage(Object JavaDoc object) {
190         return getResourceLocator().getImage("full/obj16/VariableColumnType");
191     }
192
193     /**
194      * This returns the label text for the adapted class.
195      * <!-- begin-user-doc -->
196      * <!-- end-user-doc -->
197      * @generated
198      */

199     public String JavaDoc getText(Object JavaDoc object) {
200         String JavaDoc label = ((VariableColumnType)object).getName();
201         return label == null || label.length() == 0 ?
202             getString("_UI_VariableColumnType_type") :
203             getString("_UI_VariableColumnType_type") + " " + label;
204     }
205
206     /**
207      * This handles model notifications by calling {@link #updateChildren} to update any cached
208      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
209      * <!-- begin-user-doc -->
210      * <!-- end-user-doc -->
211      * @generated
212      */

213     public void notifyChanged(Notification notification) {
214         updateChildren(notification);
215
216         switch (notification.getFeatureID(VariableColumnType.class)) {
217             case OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE:
218             case OljPackage.VARIABLE_COLUMN_TYPE__NAME:
219             case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME:
220             case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID:
221             case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME:
222             case OljPackage.VARIABLE_COLUMN_TYPE__VALUE_MODE:
223                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
224                 return;
225         }
226         super.notifyChanged(notification);
227     }
228
229     /**
230      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
231      * describing all of the children that can be created under this object.
232      * <!-- begin-user-doc -->
233      * <!-- end-user-doc -->
234      * @generated
235      */

236     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
237         super.collectNewChildDescriptors(newChildDescriptors, object);
238     }
239
240     /**
241      * Return the resource locator for this item provider's resources.
242      * <!-- begin-user-doc -->
243      * <!-- end-user-doc -->
244      * @generated
245      */

246     public ResourceLocator getResourceLocator() {
247         return OljEditPlugin.INSTANCE;
248     }
249
250 }
251
Popular Tags