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