KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > VariableColumnsTypeItemProvider


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

7 package Olj.provider;
8
9
10 import Olj.OljFactory;
11 import Olj.OljPackage;
12 import Olj.VariableColumnsType;
13
14 import java.util.Collection JavaDoc;
15 import java.util.List JavaDoc;
16
17 import org.eclipse.emf.common.notify.AdapterFactory;
18 import org.eclipse.emf.common.notify.Notification;
19
20 import org.eclipse.emf.common.util.ResourceLocator;
21
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.ItemProviderAdapter;
28 import org.eclipse.emf.edit.provider.ViewerNotification;
29
30 /**
31  * This is the item provider adpater for a {@link Olj.VariableColumnsType} object.
32  * <!-- begin-user-doc -->
33  * <!-- end-user-doc -->
34  * @generated
35  */

36 public class VariableColumnsTypeItemProvider
37     extends ItemProviderAdapter
38     implements
39         IEditingDomainItemProvider,
40         IStructuredItemContentProvider,
41         ITreeItemContentProvider,
42         IItemLabelProvider,
43         IItemPropertySource {
44     /**
45      * This constructs an instance from a factory and a notifier.
46      * <!-- begin-user-doc -->
47      * <!-- end-user-doc -->
48      * @generated
49      */

50     public VariableColumnsTypeItemProvider(AdapterFactory adapterFactory) {
51         super(adapterFactory);
52     }
53
54     /**
55      * This returns the property descriptors for the adapted class.
56      * <!-- begin-user-doc -->
57      * <!-- end-user-doc -->
58      * @generated
59      */

60     public List JavaDoc getPropertyDescriptors(Object JavaDoc object) {
61         if (itemPropertyDescriptors == null) {
62             super.getPropertyDescriptors(object);
63
64         }
65         return itemPropertyDescriptors;
66     }
67
68     /**
69      * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
70      * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
71      * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
72      * <!-- begin-user-doc -->
73      * <!-- end-user-doc -->
74      * @generated
75      */

76     public Collection JavaDoc getChildrenFeatures(Object JavaDoc object) {
77         if (childrenFeatures == null) {
78             super.getChildrenFeatures(object);
79             childrenFeatures.add(OljPackage.eINSTANCE.getVariableColumnsType_Group());
80         }
81         return childrenFeatures;
82     }
83
84     /**
85      * This returns VariableColumnsType.gif.
86      * <!-- begin-user-doc -->
87      * <!-- end-user-doc -->
88      * @generated
89      */

90     public Object JavaDoc getImage(Object JavaDoc object) {
91         return getResourceLocator().getImage("full/obj16/VariableColumnsType");
92     }
93
94     /**
95      * This returns the label text for the adapted class.
96      * <!-- begin-user-doc -->
97      * <!-- end-user-doc -->
98      * @generated
99      */

100     public String JavaDoc getText(Object JavaDoc object) {
101         return getString("_UI_VariableColumnsType_type");
102     }
103
104     /**
105      * This handles model notifications by calling {@link #updateChildren} to update any cached
106      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
107      * <!-- begin-user-doc -->
108      * <!-- end-user-doc -->
109      * @generated
110      */

111     public void notifyChanged(Notification notification) {
112         updateChildren(notification);
113
114         switch (notification.getFeatureID(VariableColumnsType.class)) {
115             case OljPackage.VARIABLE_COLUMNS_TYPE__GROUP:
116                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
117                 return;
118         }
119         super.notifyChanged(notification);
120     }
121
122     /**
123      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
124      * describing all of the children that can be created under this object.
125      * <!-- begin-user-doc -->
126      * <!-- end-user-doc -->
127      * @generated
128      */

129     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
130         super.collectNewChildDescriptors(newChildDescriptors, object);
131
132         newChildDescriptors.add
133             (createChildParameter
134                 (OljPackage.eINSTANCE.getVariableColumnsType_VariableColumn(),
135                  OljFactory.eINSTANCE.createVariableColumnType()));
136
137         newChildDescriptors.add
138             (createChildParameter
139                 (OljPackage.eINSTANCE.getVariableColumnsType_UserIDColumn(),
140                  OljFactory.eINSTANCE.createUserIDColumnType()));
141
142         newChildDescriptors.add
143             (createChildParameter
144                 (OljPackage.eINSTANCE.getVariableColumnsType_TimeStampColumn(),
145                  OljFactory.eINSTANCE.createTimeStampColumnType()));
146     }
147
148     /**
149      * Return the resource locator for this item provider's resources.
150      * <!-- begin-user-doc -->
151      * <!-- end-user-doc -->
152      * @generated
153      */

154     public ResourceLocator getResourceLocator() {
155         return OljEditPlugin.INSTANCE;
156     }
157
158 }
159
Popular Tags