KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > sdo > provider > EDataGraphItemProvider


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: EDataGraphItemProvider.java,v 1.5 2005/06/08 06:17:15 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.sdo.provider;
18
19
20 import java.util.Collection JavaDoc;
21 import java.util.List JavaDoc;
22
23 import org.eclipse.emf.common.notify.AdapterFactory;
24 import org.eclipse.emf.common.notify.Notification;
25 import org.eclipse.emf.common.util.ResourceLocator;
26 import org.eclipse.emf.ecore.EStructuralFeature;
27
28 import org.eclipse.emf.ecore.sdo.EDataGraph;
29 import org.eclipse.emf.ecore.sdo.SDOPackage;
30 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
31 import org.eclipse.emf.edit.provider.IItemLabelProvider;
32 import org.eclipse.emf.edit.provider.IItemPropertySource;
33 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
34 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
35 import org.eclipse.emf.edit.provider.ItemProviderAdapter;
36
37 import org.eclipse.emf.edit.provider.ViewerNotification;
38
39 //import org.eclipse.emf.ecore.resource.ResourceSet;
40

41
42 /**
43  * This is the item provider adapter for a {@link org.eclipse.emf.ecore.sdo.EDataGraph} object.
44  * <!-- begin-user-doc -->
45  * <!-- end-user-doc -->
46  * @generated
47  */

48 public class EDataGraphItemProvider
49   extends ItemProviderAdapter
50   implements
51     IEditingDomainItemProvider,
52     IStructuredItemContentProvider,
53     ITreeItemContentProvider,
54     IItemLabelProvider,
55     IItemPropertySource
56 {
57   /**
58    * This constructs an instance from a factory and a notifier.
59    * <!-- begin-user-doc -->
60    * <!-- end-user-doc -->
61    * @generated
62    */

63   public EDataGraphItemProvider(AdapterFactory adapterFactory)
64   {
65     super(adapterFactory);
66   }
67
68   /**
69    * This returns the property descriptors for the adapted class.
70    * <!-- begin-user-doc -->
71    * <!-- end-user-doc -->
72    * @generated
73    */

74   public List JavaDoc getPropertyDescriptors(Object JavaDoc object)
75   {
76     if (itemPropertyDescriptors == null)
77     {
78       super.getPropertyDescriptors(object);
79
80     }
81     return itemPropertyDescriptors;
82   }
83
84   /**
85    * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
86    * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
87    * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
88    * <!-- begin-user-doc -->
89    * <!-- end-user-doc -->
90    * @generated NOT
91    */

92   public Collection JavaDoc getChildrenFeatures(Object JavaDoc object)
93   {
94     if (childrenFeatures == null)
95     {
96       super.getChildrenFeatures(object);
97       childrenFeatures.add(SDOPackage.eINSTANCE.getEDataGraph_ERootObject());
98       childrenFeatures.add(SDOPackage.eINSTANCE.getEDataGraph_EChangeSummary());
99     }
100     return childrenFeatures;
101   }
102
103   /**
104    * <!-- begin-user-doc -->
105    * <!-- end-user-doc -->
106    * @generated
107    */

108   protected EStructuralFeature getChildFeature(Object JavaDoc object, Object JavaDoc child)
109   {
110     // Check the type of the specified child object and return the proper feature to use for
111
// adding (see {@link AddCommand}) it as a child.
112

113     return super.getChildFeature(object, child);
114   }
115
116   /**
117    * This returns EDataGraph.gif.
118    * <!-- begin-user-doc -->
119    * <!-- end-user-doc -->
120    * @generated
121    */

122   public Object JavaDoc getImage(Object JavaDoc object)
123   {
124     return getResourceLocator().getImage("full/obj16/EDataGraph");
125   }
126
127   /**
128    * This returns the label text for the adapted class.
129    * <!-- begin-user-doc -->
130    * <!-- end-user-doc -->
131    * @generated NOT
132    */

133   public String JavaDoc getText(Object JavaDoc object)
134   {
135     return getString("_UI_DataGraph_type");
136   }
137
138   /**
139    * This handles model notifications by calling {@link #updateChildren} to update any cached
140    * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
141    * <!-- begin-user-doc -->
142    * <!-- end-user-doc -->
143    * @generated
144    */

145   public void notifyChanged(Notification notification)
146   {
147     updateChildren(notification);
148
149     switch (notification.getFeatureID(EDataGraph.class))
150     {
151       case SDOPackage.EDATA_GRAPH__ECHANGE_SUMMARY:
152       case SDOPackage.EDATA_GRAPH__EROOT_OBJECT:
153         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
154         return;
155     }
156     super.notifyChanged(notification);
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   {
167     return SDOEditPlugin.INSTANCE;
168   }
169
170 }
171
Popular Tags