KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > JdbcDefaultParametersTypeItemProvider


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

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

38 public class JdbcDefaultParametersTypeItemProvider
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 JdbcDefaultParametersTypeItemProvider(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.getJdbcDefaultParametersType_JdbcSourceParameters());
82             childrenFeatures.add(OljPackage.eINSTANCE.getJdbcDefaultParametersType_JdbcTargetParameters());
83         }
84         return childrenFeatures;
85     }
86
87     /**
88      * <!-- begin-user-doc -->
89      * <!-- end-user-doc -->
90      * @generated
91      */

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

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

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

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

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

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

165     public ResourceLocator getResourceLocator() {
166         return OljEditPlugin.INSTANCE;
167     }
168
169 }
170
Popular Tags