KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > provider > TablesTypeItemProvider


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.TablesType;
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.TablesType} object.
32  * <!-- begin-user-doc -->
33  * <!-- end-user-doc -->
34  * @generated
35  */

36 public class TablesTypeItemProvider
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 TablesTypeItemProvider(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.getTablesType_Table());
80         }
81         return childrenFeatures;
82     }
83
84     /**
85      * This returns TablesType.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/TablesType");
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_TablesType_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(TablesType.class)) {
115             case OljPackage.TABLES_TYPE__TABLE:
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.getTablesType_Table(),
135                  OljFactory.eINSTANCE.createTableType()));
136     }
137
138     /**
139      * Return the resource locator for this item provider's resources.
140      * <!-- begin-user-doc -->
141      * <!-- end-user-doc -->
142      * @generated
143      */

144     public ResourceLocator getResourceLocator() {
145         return OljEditPlugin.INSTANCE;
146     }
147
148 }
149
Popular Tags