001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.provider;
007:
008: import java.util.Collection;
009: import java.util.List;
010:
011: import newprocess.NewprocessPackage;
012:
013: import org.eclipse.emf.common.notify.AdapterFactory;
014: import org.eclipse.emf.common.notify.Notification;
015:
016: import org.eclipse.emf.common.util.ResourceLocator;
017:
018: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
019: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
020: import org.eclipse.emf.edit.provider.IItemLabelProvider;
021: import org.eclipse.emf.edit.provider.IItemPropertySource;
022: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
023: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
024: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
025:
026: /**
027: * This is the item provider adapter for a {@link newprocess.Root} object.
028: * <!-- begin-user-doc -->
029: * <!-- end-user-doc -->
030: * @generated
031: */
032: public class RootItemProvider extends ItemProviderAdapter implements
033: IEditingDomainItemProvider, IStructuredItemContentProvider,
034: ITreeItemContentProvider, IItemLabelProvider,
035: IItemPropertySource {
036: /**
037: * This constructs an instance from a factory and a notifier.
038: * <!-- begin-user-doc -->
039: * <!-- end-user-doc -->
040: * @generated
041: */
042: public RootItemProvider(AdapterFactory adapterFactory) {
043: super (adapterFactory);
044: }
045:
046: /**
047: * This returns the property descriptors for the adapted class.
048: * <!-- begin-user-doc -->
049: * <!-- end-user-doc -->
050: * @generated
051: */
052: public List getPropertyDescriptors(Object object) {
053: if (itemPropertyDescriptors == null) {
054: super .getPropertyDescriptors(object);
055:
056: addTermPropertyDescriptor(object);
057: }
058: return itemPropertyDescriptors;
059: }
060:
061: /**
062: * This adds a property descriptor for the Term feature.
063: * <!-- begin-user-doc -->
064: * <!-- end-user-doc -->
065: * @generated
066: */
067: protected void addTermPropertyDescriptor(Object object) {
068: itemPropertyDescriptors.add(createItemPropertyDescriptor(
069: ((ComposeableAdapterFactory) adapterFactory)
070: .getRootAdapterFactory(), getResourceLocator(),
071: getString("_UI_Root_term_feature"), getString(
072: "_UI_PropertyDescriptor_description",
073: "_UI_Root_term_feature", "_UI_Root_type"),
074: NewprocessPackage.Literals.ROOT__TERM, false, false,
075: true, null, null, null));
076: }
077:
078: /**
079: * This returns Root.gif.
080: * <!-- begin-user-doc -->
081: * <!-- end-user-doc -->
082: * @generated
083: */
084: public Object getImage(Object object) {
085: return overlayImage(object, getResourceLocator().getImage(
086: "full/obj16/Root"));
087: }
088:
089: /**
090: * This returns the label text for the adapted class.
091: * <!-- begin-user-doc -->
092: * <!-- end-user-doc -->
093: * @generated
094: */
095: public String getText(Object object) {
096: return getString("_UI_Root_type");
097: }
098:
099: /**
100: * This handles model notifications by calling {@link #updateChildren} to update any cached
101: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
102: * <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: * @generated
105: */
106: public void notifyChanged(Notification notification) {
107: updateChildren(notification);
108: super .notifyChanged(notification);
109: }
110:
111: /**
112: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
113: * describing all of the children that can be created under this object.
114: * <!-- begin-user-doc -->
115: * <!-- end-user-doc -->
116: * @generated
117: */
118: protected void collectNewChildDescriptors(
119: Collection newChildDescriptors, Object object) {
120: super .collectNewChildDescriptors(newChildDescriptors, object);
121: }
122:
123: /**
124: * Return the resource locator for this item provider's resources.
125: * <!-- begin-user-doc -->
126: * <!-- end-user-doc -->
127: * @generated
128: */
129: public ResourceLocator getResourceLocator() {
130: return New_processEditPlugin.INSTANCE;
131: }
132:
133: }
|