/** * Copyright (c) 2016 CEA LIST and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * CEA LIST - Initial API and implementation * */ package org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.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 org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.IAssociationEndHandle; import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.UMLRhapsodyPackage; /** * This is the item provider adapter for a {@link org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.IAssociationEndHandle} object. * * * @generated */ public class IAssociationEndHandleItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * * * @generated */ public IAssociationEndHandleItemProvider(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); addM2ClassPropertyDescriptor(object); addFilenamePropertyDescriptor(object); addSubsystemPropertyDescriptor(object); addClassPropertyDescriptor(object); addNamePropertyDescriptor(object); addIdPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the M2 Class feature. * * * @generated */ protected void addM2ClassPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_m2Class_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_m2Class_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_M2Class(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Filename feature. * * * @generated */ protected void addFilenamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_filename_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_filename_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_Filename(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Subsystem feature. * * * @generated */ protected void addSubsystemPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_subsystem_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_subsystem_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_Subsystem(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Class feature. * * * @generated */ protected void addClassPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_class_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_class_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_Class(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Name feature. * * * @generated */ protected void addNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_name_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_name_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_Name(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Id feature. * * * @generated */ protected void addIdPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IAssociationEndHandle_id_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_IAssociationEndHandle_id_feature", "_UI_IAssociationEndHandle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ UMLRhapsodyPackage.eINSTANCE.getIAssociationEndHandle_Id(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This returns IAssociationEndHandle.gif. * * * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/IAssociationEndHandle")); //$NON-NLS-1$ } /** * This returns the label text for the adapted class. * * * @generated */ @Override public String getText(Object object) { String label = ((IAssociationEndHandle)object).getName(); return label == null || label.length() == 0 ? getString("_UI_IAssociationEndHandle_type") : //$NON-NLS-1$ getString("_UI_IAssociationEndHandle_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ } /** * 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(IAssociationEndHandle.class)) { case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__M2_CLASS: case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__FILENAME: case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__SUBSYSTEM: case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__CLASS: case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__NAME: case UMLRhapsodyPackage.IASSOCIATION_END_HANDLE__ID: 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 rhapsodymetamodelEditPlugin.INSTANCE; } }