KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > TargetColumnTypeItemProvider


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

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

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

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

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

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

133     protected void addValueModePropertyDescriptor(Object JavaDoc object) {
134         itemPropertyDescriptors.add
135             (new ItemPropertyDescriptor
136                 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
137                  getResourceLocator(),
138                  getString("_UI_TargetColumnType_valueMode_feature"),
139                  getString("_UI_PropertyDescriptor_description", "_UI_TargetColumnType_valueMode_feature", "_UI_TargetColumnType_type"),
140                  OljPackage.eINSTANCE.getTargetColumnType_ValueMode(),
141                  true,
142                  ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
143     }
144
145     /**
146      * This returns TargetColumnType.gif.
147      * <!-- begin-user-doc -->
148      * <!-- end-user-doc -->
149      * @generated
150      */

151     public Object JavaDoc getImage(Object JavaDoc object) {
152         return getResourceLocator().getImage("full/obj16/TargetColumnType");
153     }
154
155     /**
156      * This returns the label text for the adapted class.
157      * <!-- begin-user-doc -->
158      * <!-- end-user-doc -->
159      * @generated
160      */

161     public String JavaDoc getText(Object JavaDoc object) {
162         String JavaDoc label = ((TargetColumnType)object).getName();
163         return label == null || label.length() == 0 ?
164             getString("_UI_TargetColumnType_type") :
165             getString("_UI_TargetColumnType_type") + " " + label;
166     }
167
168     /**
169      * This handles model notifications by calling {@link #updateChildren} to update any cached
170      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
171      * <!-- begin-user-doc -->
172      * <!-- end-user-doc -->
173      * @generated
174      */

175     public void notifyChanged(Notification notification) {
176         updateChildren(notification);
177
178         switch (notification.getFeatureID(TargetColumnType.class)) {
179             case OljPackage.TARGET_COLUMN_TYPE__NAME:
180             case OljPackage.TARGET_COLUMN_TYPE__TABLE_ID:
181             case OljPackage.TARGET_COLUMN_TYPE__TABLE_NAME:
182             case OljPackage.TARGET_COLUMN_TYPE__VALUE_MODE:
183                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
184                 return;
185         }
186         super.notifyChanged(notification);
187     }
188
189     /**
190      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
191      * describing all of the children that can be created under this object.
192      * <!-- begin-user-doc -->
193      * <!-- end-user-doc -->
194      * @generated
195      */

196     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
197         super.collectNewChildDescriptors(newChildDescriptors, object);
198     }
199
200     /**
201      * Return the resource locator for this item provider's resources.
202      * <!-- begin-user-doc -->
203      * <!-- end-user-doc -->
204      * @generated
205      */

206     public ResourceLocator getResourceLocator() {
207         return OljEditPlugin.INSTANCE;
208     }
209
210 }
211
Popular Tags