KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > provider > EObjectItemProvider


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-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: EObjectItemProvider.java,v 1.5 2005/06/08 06:15:46 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.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.edit.provider.IEditingDomainItemProvider;
27 import org.eclipse.emf.edit.provider.IItemLabelProvider;
28 import org.eclipse.emf.edit.provider.IItemPropertySource;
29 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
30 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
31 import org.eclipse.emf.edit.provider.ItemProviderAdapter;
32
33
34 /**
35  * This is the item provider adapter for a {@link org.eclipse.emf.ecore.EObject} object.
36  * <!-- begin-user-doc -->
37  * <!-- end-user-doc -->
38  * @generated
39  */

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

51   public EObjectItemProvider(AdapterFactory adapterFactory)
52   {
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   {
64     if (itemPropertyDescriptors == null)
65     {
66       super.getPropertyDescriptors(object);
67
68     }
69     return itemPropertyDescriptors;
70   }
71
72   /**
73    * This returns EObject.gif.
74    * <!-- begin-user-doc -->
75    * <!-- end-user-doc -->
76    * @generated
77    */

78   public Object JavaDoc getImage(Object JavaDoc object)
79   {
80     return getResourceLocator().getImage("full/obj16/EObject");
81   }
82
83   /**
84    * This returns the label text for the adapted class.
85    * <!-- begin-user-doc -->
86    * <!-- end-user-doc -->
87    * @generated
88    */

89   public String JavaDoc getText(Object JavaDoc object)
90   {
91     return getString("_UI_EObject_type");
92   }
93
94   /**
95    * This handles model notifications by calling {@link #updateChildren} to update any cached
96    * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
97    * <!-- begin-user-doc -->
98    * <!-- end-user-doc -->
99    * @generated
100    */

101   public void notifyChanged(Notification notification)
102   {
103     updateChildren(notification);
104     super.notifyChanged(notification);
105   }
106
107   /**
108    * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
109    * describing all of the children that can be created under this object.
110    * <!-- begin-user-doc -->
111    * <!-- end-user-doc -->
112    * @generated
113    */

114   protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object)
115   {
116     super.collectNewChildDescriptors(newChildDescriptors, object);
117   }
118
119   /**
120    * Return the resource locator for this item provider's resources.
121    * <!-- begin-user-doc -->
122    * <!-- end-user-doc -->
123    * @generated
124    */

125   public ResourceLocator getResourceLocator()
126   {
127     return EcoreEditPlugin.INSTANCE;
128   }
129
130 }
131
Popular Tags