/** * <copyright> * </copyright> * * $Id$ */ package com.sap.furcas.metamodel.FURCAS.textblocks.provider; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; import com.sap.furcas.metamodel.FURCAS.textblocks.ForEachExecution; import com.sap.furcas.metamodel.FURCAS.textblocks.TextblocksPackage; import com.sap.furcas.metamodel.FURCAS.textblocks.Version; /** * This is the item provider adapter for a {@link com.sap.furcas.metamodel.FURCAS.textblocks.ForEachExecution} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class ForEachExecutionItemProvider extends TextBlockItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ForEachExecutionItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addForeachPedicatePropertyInitPropertyDescriptor(object); addContextElementPropertyDescriptor(object); addResultModelElementPropertyDescriptor(object); addSourceModelElementPropertyDescriptor(object); addContextStringPropertyDescriptor(object); addTemplateUsedForProductionPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the Foreach Pedicate Property Init feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addForeachPedicatePropertyInitPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_foreachPedicatePropertyInit_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_foreachPedicatePropertyInit_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__FOREACH_PEDICATE_PROPERTY_INIT, true, false, true, null, null, null)); } /** * This adds a property descriptor for the Context Element feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addContextElementPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_contextElement_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_contextElement_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__CONTEXT_ELEMENT, true, false, true, null, null, null)); } /** * This adds a property descriptor for the Result Model Element feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addResultModelElementPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_resultModelElement_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_resultModelElement_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__RESULT_MODEL_ELEMENT, true, false, true, null, null, null)); } /** * This adds a property descriptor for the Source Model Element feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addSourceModelElementPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_sourceModelElement_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_sourceModelElement_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__SOURCE_MODEL_ELEMENT, true, false, true, null, null, null)); } /** * This adds a property descriptor for the Context String feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addContextStringPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_contextString_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_contextString_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__CONTEXT_STRING, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Template Used For Production feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addTemplateUsedForProductionPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForEachExecution_templateUsedForProduction_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForEachExecution_templateUsedForProduction_feature", "_UI_ForEachExecution_type"), TextblocksPackage.Literals.FOR_EACH_EXECUTION__TEMPLATE_USED_FOR_PRODUCTION, true, false, true, null, null, null)); } /** * This returns ForEachExecution.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ForEachExecution")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { Version labelValue = ((ForEachExecution)object).getVersion(); String label = labelValue == null ? null : labelValue.toString(); return label == null || label.length() == 0 ? getString("_UI_ForEachExecution_type") : getString("_UI_ForEachExecution_type") + " " + label; } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ForEachExecution.class)) { case TextblocksPackage.FOR_EACH_EXECUTION__CONTEXT_STRING: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } /** * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; boolean qualify = childFeature == TextblocksPackage.Literals.TEXT_BLOCK__SUB_NODES || childFeature == TextblocksPackage.Literals.TEXT_BLOCK__FOR_EACH_EXECUTIONS; if (qualify) { return getString ("_UI_CreateChild_text2", new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); } return super.getCreateChildText(owner, feature, child, selection); } }