/** * <copyright> * </copyright> * * $Id$ */ package org.eclipse.gmf.codegen.gmfgen.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.IChildCreationExtender; 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 org.eclipse.gmf.codegen.gmfgen.GMFGenPackage; import org.eclipse.gmf.codegen.gmfgen.GenPlugin; /** * This is the item provider adapter for a {@link org.eclipse.gmf.codegen.gmfgen.GenPlugin} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class GenPluginItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public GenPluginItemProvider(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); addIDPropertyDescriptor(object); addNamePropertyDescriptor(object); addProviderPropertyDescriptor(object); addVersionPropertyDescriptor(object); addPrintingEnabledPropertyDescriptor(object); addRequiredPluginsPropertyDescriptor(object); addActivatorClassNamePropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the ID feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addIDPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_iD_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_iD_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_ID(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Name feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_name_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_name_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_Name(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Provider feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addProviderPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_provider_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_provider_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_Provider(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Version feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addVersionPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_version_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_version_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_Version(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Printing Enabled feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addPrintingEnabledPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_printingEnabled_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_printingEnabled_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_PrintingEnabled(), true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Required Plugins feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addRequiredPluginsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_requiredPlugins_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_requiredPlugins_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_RequiredPlugins(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Activator Class Name feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addActivatorClassNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GenPlugin_activatorClassName_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GenPlugin_activatorClassName_feature", "_UI_GenPlugin_type"), GMFGenPackage.eINSTANCE.getGenPlugin_ActivatorClassName(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This returns GenPlugin.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/GenPlugin")); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected boolean shouldComposeCreationImage() { return true; } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { String label = ((GenPlugin)object).getName(); return label == null || label.length() == 0 ? getString("_UI_GenPlugin_type") : getString("_UI_GenPlugin_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(GenPlugin.class)) { case GMFGenPackage.GEN_PLUGIN__ID: case GMFGenPackage.GEN_PLUGIN__NAME: case GMFGenPackage.GEN_PLUGIN__PROVIDER: case GMFGenPackage.GEN_PLUGIN__VERSION: case GMFGenPackage.GEN_PLUGIN__PRINTING_ENABLED: case GMFGenPackage.GEN_PLUGIN__REQUIRED_PLUGINS: case GMFGenPackage.GEN_PLUGIN__ACTIVATOR_CLASS_NAME: 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); } /** * Return the resource locator for this item provider's resources. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public ResourceLocator getResourceLocator() { return ((IChildCreationExtender)adapterFactory).getResourceLocator(); } }