KickJava   Java API By Example, From Geeks To Geeks.

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


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

40 public class EParameterItemProvider
41   extends ETypedElementItemProvider
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 EParameterItemProvider(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 EParameter.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/EParameter");
81   }
82
83   /**
84    * This returns the label text for the adapted class.
85    * <!-- begin-user-doc -->
86    * <!-- end-user-doc -->
87    * @generated NOT
88    */

89   public String JavaDoc getText(Object JavaDoc object)
90   {
91     EParameter eParameter = (EParameter)object;
92     StringBuffer JavaDoc result = new StringBuffer JavaDoc();
93     result.append(eParameter.getName());
94     if (eParameter.getEType() != null)
95     {
96       result.append(" : ");
97       result.append(eParameter.getEType().getName());
98     }
99     return result.toString();
100   }
101
102   /**
103    * This handles model notifications by calling {@link #updateChildren} to update any cached
104    * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
105    * <!-- begin-user-doc -->
106    * <!-- end-user-doc -->
107    * @generated
108    */

109   public void notifyChanged(Notification notification)
110   {
111     updateChildren(notification);
112     super.notifyChanged(notification);
113   }
114
115   /**
116    * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
117    * describing all of the children that can be created under this object.
118    * <!-- begin-user-doc -->
119    * <!-- end-user-doc -->
120    * @generated
121    */

122   protected void collectNewChildDescriptors(Collection JavaDoc newChildDescriptors, Object JavaDoc object)
123   {
124     super.collectNewChildDescriptors(newChildDescriptors, object);
125   }
126
127   /**
128    * Return the resource locator for this item provider's resources.
129    * <!-- begin-user-doc -->
130    * <!-- end-user-doc -->
131    * @generated
132    */

133   public ResourceLocator getResourceLocator()
134   {
135     return EcoreEditPlugin.INSTANCE;
136   }
137
138 }
139
Popular Tags