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