KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > JdbcParametersTypeItemProvider


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

7 package Olj.provider;
8
9
10 import Olj.JdbcParametersType;
11 import Olj.OljFactory;
12 import Olj.OljPackage;
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.ecore.EStructuralFeature;
23
24 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
25 import org.eclipse.emf.edit.provider.IItemLabelProvider;
26 import org.eclipse.emf.edit.provider.IItemPropertySource;
27 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
28 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
29 import org.eclipse.emf.edit.provider.ItemProviderAdapter;
30 import org.eclipse.emf.edit.provider.ViewerNotification;
31
32 /**
33  * This is the item provider adpater for a {@link Olj.JdbcParametersType} object.
34  * <!-- begin-user-doc -->
35  * <!-- end-user-doc -->
36  * @generated
37  */

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

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

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

78     public Collection JavaDoc getChildrenFeatures(Object JavaDoc object) {
79         if (childrenFeatures == null) {
80             super.getChildrenFeatures(object);
81             childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceTargetParameters());
82             childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceParameters());
83             childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcTargetParameters());
84         }
85         return childrenFeatures;
86     }
87
88     /**
89      * <!-- begin-user-doc -->
90      * <!-- end-user-doc -->
91      * @generated
92      */

93     protected EStructuralFeature getChildFeature(Object JavaDoc object, Object JavaDoc child) {
94         // Check the type of the specified child object and return the proper feature to use for
95
// adding (see {@link AddCommand}) it as a child.
96

97         return super.getChildFeature(object, child);
98     }
99
100     /**
101      * This returns JdbcParametersType.gif.
102      * <!-- begin-user-doc -->
103      * <!-- end-user-doc -->
104      * @generated
105      */

106     public Object JavaDoc getImage(Object JavaDoc object) {
107         return getResourceLocator().getImage("full/obj16/JdbcParametersType");
108     }
109
110     /**
111      * This returns the label text for the adapted class.
112      * <!-- begin-user-doc -->
113      * <!-- end-user-doc -->
114      * @generated
115      */

116     public String JavaDoc getText(Object JavaDoc object) {
117         return getString("_UI_JdbcParametersType_type");
118     }
119
120     /**
121      * This handles model notifications by calling {@link #updateChildren} to update any cached
122      * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
123      * <!-- begin-user-doc -->
124      * <!-- end-user-doc -->
125      * @generated
126      */

127     public void notifyChanged(Notification notification) {
128         updateChildren(notification);
129
130         switch (notification.getFeatureID(JdbcParametersType.class)) {
131             case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_SOURCE_TARGET_PARAMETERS:
132             case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_SOURCE_PARAMETERS:
133             case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_TARGET_PARAMETERS:
134                 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
135                 return;
136         }
137         super.notifyChanged(notification);
138     }
139
140     /**
141      * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
142      * describing all of the children that can be created under this object.
143      * <!-- begin-user-doc -->
144      * <!-- end-user-doc -->
145      * @generated
146      */

147     protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object) {
148         super.collectNewChildDescriptors(newChildDescriptors, object);
149
150         newChildDescriptors.add
151             (createChildParameter
152                 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceTargetParameters(),
153                  OljFactory.eINSTANCE.createJdbcSourceTargetParametersType()));
154
155         newChildDescriptors.add
156             (createChildParameter
157                 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceParameters(),
158                  OljFactory.eINSTANCE.createJdbcSourceParametersType()));
159
160         newChildDescriptors.add
161             (createChildParameter
162                 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcTargetParameters(),
163                  OljFactory.eINSTANCE.createJdbcTargetParametersType()));
164     }
165
166     /**
167      * Return the resource locator for this item provider's resources.
168      * <!-- begin-user-doc -->
169      * <!-- end-user-doc -->
170      * @generated
171      */

172     public ResourceLocator getResourceLocator() {
173         return OljEditPlugin.INSTANCE;
174     }
175
176 }
177
Popular Tags