/** */ package rba.core.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.common.util.ResourceLocator; 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.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; import rba.core.Expression; import rba.core.ExpressionType; import rba.core.RBACorePackage; /** * This is the item provider adapter for a {@link rba.core.Expression} object. * * @generated */ public class ExpressionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * * @generated */ public ExpressionItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * * @generated */ @Override public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addTypePropertyDescriptor(object); addExpressionPropertyDescriptor(object); addLetStatementsPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the Type feature. * * @generated */ protected void addTypePropertyDescriptor(Object object) { itemPropertyDescriptors .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Expression_type_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Expression_type_feature", "_UI_Expression_type"), RBACorePackage.Literals.EXPRESSION__TYPE, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Expression feature. * * @generated */ protected void addExpressionPropertyDescriptor(Object object) { itemPropertyDescriptors .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Expression_expression_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Expression_expression_feature", "_UI_Expression_type"), RBACorePackage.Literals.EXPRESSION__EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Let Statements feature. * * @generated */ protected void addLetStatementsPropertyDescriptor(Object object) { itemPropertyDescriptors .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Expression_letStatements_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Expression_letStatements_feature", "_UI_Expression_type"), RBACorePackage.Literals.EXPRESSION__LET_STATEMENTS, true, false, true, null, null, null)); } /** * * @generated */ @Override protected boolean shouldComposeCreationImage() { return true; } /** * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { ExpressionType labelValue = ((Expression) object).getType(); String label = labelValue == null ? null : labelValue.toString(); return label == null || label.length() == 0 ? getString("_UI_Expression_type") : getString("_UI_Expression_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}. * * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Expression.class)) { case RBACorePackage.EXPRESSION__TYPE: case RBACorePackage.EXPRESSION__EXPRESSION: 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. * * @generated */ @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } /** * Return the resource locator for this item provider's resources. * * @generated */ @Override public ResourceLocator getResourceLocator() { return RbaCoreEditPlugin.INSTANCE; } }