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.Globals;
012: import newprocess.NewprocessFactory;
013: import newprocess.NewprocessPackage;
014:
015: import org.eclipse.emf.common.notify.AdapterFactory;
016: import org.eclipse.emf.common.notify.Notification;
017:
018: import org.eclipse.emf.common.util.ResourceLocator;
019:
020: import org.eclipse.emf.ecore.EStructuralFeature;
021:
022: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
023: import org.eclipse.emf.edit.provider.IItemLabelProvider;
024: import org.eclipse.emf.edit.provider.IItemPropertySource;
025: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
026: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
027: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
028: import org.eclipse.emf.edit.provider.ViewerNotification;
029:
030: /**
031: * This is the item provider adapter for a {@link newprocess.Globals} object.
032: * <!-- begin-user-doc -->
033: * <!-- end-user-doc -->
034: * @generated
035: */
036: public class GlobalsItemProvider extends ItemProviderAdapter implements
037: IEditingDomainItemProvider, IStructuredItemContentProvider,
038: ITreeItemContentProvider, IItemLabelProvider,
039: IItemPropertySource {
040: /**
041: * This constructs an instance from a factory and a notifier.
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @generated
045: */
046: public GlobalsItemProvider(AdapterFactory adapterFactory) {
047: super (adapterFactory);
048: }
049:
050: /**
051: * This returns the property descriptors for the adapted class.
052: * <!-- begin-user-doc -->
053: * <!-- end-user-doc -->
054: * @generated
055: */
056: public List getPropertyDescriptors(Object object) {
057: if (itemPropertyDescriptors == null) {
058: super .getPropertyDescriptors(object);
059:
060: }
061: return itemPropertyDescriptors;
062: }
063:
064: /**
065: * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
066: * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
067: * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
068: * <!-- begin-user-doc -->
069: * <!-- end-user-doc -->
070: * @generated
071: */
072: public Collection getChildrenFeatures(Object object) {
073: if (childrenFeatures == null) {
074: super .getChildrenFeatures(object);
075: childrenFeatures
076: .add(NewprocessPackage.Literals.GLOBALS__HAS_CONDITION);
077: childrenFeatures
078: .add(NewprocessPackage.Literals.GLOBALS__HAS_LOADER);
079: }
080: return childrenFeatures;
081: }
082:
083: /**
084: * <!-- begin-user-doc -->
085: * <!-- end-user-doc -->
086: * @generated
087: */
088: protected EStructuralFeature getChildFeature(Object object,
089: Object child) {
090: // Check the type of the specified child object and return the proper feature to use for
091: // adding (see {@link AddCommand}) it as a child.
092:
093: return super .getChildFeature(object, child);
094: }
095:
096: /**
097: * This returns Globals.gif.
098: * <!-- begin-user-doc -->
099: * <!-- end-user-doc -->
100: * @generated
101: */
102: public Object getImage(Object object) {
103: return overlayImage(object, getResourceLocator().getImage(
104: "full/obj16/Globals"));
105: }
106:
107: /**
108: * This returns the label text for the adapted class.
109: * <!-- begin-user-doc -->
110: * <!-- end-user-doc -->
111: * @generated
112: */
113: public String getText(Object object) {
114: return getString("_UI_Globals_type");
115: }
116:
117: /**
118: * This handles model notifications by calling {@link #updateChildren} to update any cached
119: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
120: * <!-- begin-user-doc -->
121: * <!-- end-user-doc -->
122: * @generated
123: */
124: public void notifyChanged(Notification notification) {
125: updateChildren(notification);
126:
127: switch (notification.getFeatureID(Globals.class)) {
128: case NewprocessPackage.GLOBALS__HAS_CONDITION:
129: case NewprocessPackage.GLOBALS__HAS_LOADER:
130: fireNotifyChanged(new ViewerNotification(notification,
131: notification.getNotifier(), true, false));
132: return;
133: }
134: super .notifyChanged(notification);
135: }
136:
137: /**
138: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
139: * describing all of the children that can be created under this object.
140: * <!-- begin-user-doc -->
141: * <!-- end-user-doc -->
142: * @generated
143: */
144: protected void collectNewChildDescriptors(
145: Collection newChildDescriptors, Object object) {
146: super .collectNewChildDescriptors(newChildDescriptors, object);
147:
148: newChildDescriptors.add(createChildParameter(
149: NewprocessPackage.Literals.GLOBALS__HAS_CONDITION,
150: NewprocessFactory.eINSTANCE.createCondition()));
151:
152: newChildDescriptors.add(createChildParameter(
153: NewprocessPackage.Literals.GLOBALS__HAS_LOADER,
154: NewprocessFactory.eINSTANCE.createLoader()));
155: }
156:
157: /**
158: * Return the resource locator for this item provider's resources.
159: * <!-- begin-user-doc -->
160: * <!-- end-user-doc -->
161: * @generated
162: */
163: public ResourceLocator getResourceLocator() {
164: return New_processEditPlugin.INSTANCE;
165: }
166:
167: }
|