KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > provider > DocumentRootItemProvider


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

7 package org.enhydra.dods.editor.Doml.provider;
8
9
10 import java.util.Collection JavaDoc;
11 import java.util.List JavaDoc;
12
13 import org.eclipse.emf.common.notify.AdapterFactory;
14 import org.eclipse.emf.common.notify.Notification;
15
16 import org.eclipse.emf.common.util.ResourceLocator;
17
18 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
19 import org.eclipse.emf.edit.provider.IItemLabelProvider;
20 import org.eclipse.emf.edit.provider.IItemPropertySource;
21 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
22 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
23 import org.eclipse.emf.edit.provider.ItemProviderAdapter;
24 import org.eclipse.emf.edit.provider.ViewerNotification;
25
26 import org.enhydra.dods.editor.Doml.DocumentRoot;
27 import org.enhydra.dods.editor.Doml.DomlFactory;
28 import org.enhydra.dods.editor.Doml.DomlPackage;
29
30 /**
31  * This is the item provider adpater for a {@link org.enhydra.dods.editor.Doml.DocumentRoot} object.
32  * <!-- begin-user-doc -->
33  * <!-- end-user-doc -->
34  * @generated
35  */

36 public class DocumentRootItemProvider
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 DocumentRootItemProvider(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(DomlPackage.eINSTANCE.getDocumentRoot_Mixed());
80         }
81         return childrenFeatures;
82     }
83
84     /**
85      * This returns DocumentRoot.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/DocumentRoot");
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_DocumentRoot_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(DocumentRoot.class)) {
115             case DomlPackage.DOCUMENT_ROOT__MIXED:
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                 (DomlPackage.eINSTANCE.getDocumentRoot_Column(),
135                  DomlFactory.eINSTANCE.createColumnType()));
136
137         newChildDescriptors.add
138             (createChildParameter
139                 (DomlPackage.eINSTANCE.getDocumentRoot_Database(),
140                  DomlFactory.eINSTANCE.createDatabaseType()));
141
142         newChildDescriptors.add
143             (createChildParameter
144                 (DomlPackage.eINSTANCE.getDocumentRoot_Doml(),
145                  DomlFactory.eINSTANCE.createDomlType()));
146
147         newChildDescriptors.add
148             (createChildParameter
149                 (DomlPackage.eINSTANCE.getDocumentRoot_Index(),
150                  DomlFactory.eINSTANCE.createIndexType()));
151
152         newChildDescriptors.add
153             (createChildParameter
154                 (DomlPackage.eINSTANCE.getDocumentRoot_IndexColumn(),
155                  DomlFactory.eINSTANCE.createIndexColumnType()));
156
157         newChildDescriptors.add
158             (createChildParameter
159                 (DomlPackage.eINSTANCE.getDocumentRoot_Package(),
160                  DomlFactory.eINSTANCE.createPackageType()));
161
162         newChildDescriptors.add
163             (createChildParameter
164                 (DomlPackage.eINSTANCE.getDocumentRoot_ReferenceObject(),
165                  DomlFactory.eINSTANCE.createReferenceObjectType()));
166
167         newChildDescriptors.add
168             (createChildParameter
169                 (DomlPackage.eINSTANCE.getDocumentRoot_Table(),
170                  DomlFactory.eINSTANCE.createTableType()));
171
172         newChildDescriptors.add
173             (createChildParameter
174                 (DomlPackage.eINSTANCE.getDocumentRoot_Type(),
175                  DomlFactory.eINSTANCE.createTypeType()));
176     }
177
178     /**
179      * Return the resource locator for this item provider's resources.
180      * <!-- begin-user-doc -->
181      * <!-- end-user-doc -->
182      * @generated
183      */

184     public ResourceLocator getResourceLocator() {
185         return DomlEditPlugin.INSTANCE;
186     }
187
188 }
189
Popular Tags