gt: 		if (qualify) {
context: /**
   * Copyright (c) 2014 University of Southampton.
   * 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
   *
   * $Id$
   */
  package ac.soton.rms.components.provider;
  
  
  import ac.soton.eventb.emf.core.extension.coreextension.provider.EventBLabeledItemProvider;
  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.ecore.EStructuralFeature;
  import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
  import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
  import org.eclipse.emf.edit.provider.IItemColorProvider;
  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.ITableItemColorProvider;
  import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
  import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
  import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
  import org.eclipse.emf.edit.provider.ViewerNotification;
  import org.eventb.emf.core.CorePackage;
  import ac.soton.rms.components.ComponentsFactory;
  import ac.soton.rms.components.ComponentsPackage;
  import ac.soton.rms.components.FMUComponent;
  
  /**
   * This is the item provider adapter for a {@link ac.soton.rms.components.FMUComponent} object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public class FMUComponentItemProvider
  	extends EventBLabeledItemProvider
  	implements
  		IEditingDomainItemProvider,
  		IStructuredItemContentProvider,
  		ITreeItemContentProvider,
  		IItemLabelProvider,
  		IItemPropertySource,
  		ITableItemLabelProvider,
  		ITableItemColorProvider,
  		IItemColorProvider {
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public static final String copyright = "Copyright (c) 2014 University of Southampton.\nAll rights reserved. This program and the accompanying materials\nare made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp://www.eclipse.org/legal/epl-v10.html";
  
  	/**
  	 * This constructs an instance from a factory and a notifier.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public FMUComponentItemProvider(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);
  
  			addNamePropertyDescriptor(object);
  			addPathPropertyDescriptor(object);
  			addParametersPropertyDescriptor(object);
  			addFmuPropertyDescriptor(object);
  		}
  		return itemPropertyDescriptors;
  	}
  
  	/**
  	 * 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_EventBNamed_name_feature"),
  				 getString("_UI_PropertyDescriptor_description", "_UI_EventBNamed_name_feature", "_UI_EventBNamed_type"),
  				 CorePackage.Literals.EVENT_BNAMED__NAME,
  				 true,
  				 false,
  				 false,
  				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
  				 null,
  				 null));
  	}
  
  	/**
  	 * This adds a property descriptor for the Path feature.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	protected void addPathPropertyDescriptor(Object object) {
  		itemPropertyDescriptors.add
  			(createItemPropertyDescriptor
  				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
  				 getResourceLocator(),
  				 getString("_UI_FMUComponent_path_feature"),
  				 getString("_UI_PropertyDescriptor_description", "_UI_FMUComponent_path_feature", "_UI_FMUComponent_type"),
  				 ComponentsPackage.Literals.FMU_COMPONENT__PATH,
  				 true,
  				 false,
  				 false,
  				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
  				 null,
  				 null));
  	}
  
  	/**
  	 * This adds a property descriptor for the Parameters feature.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	protected void addParametersPropertyDescriptor(Object object) {
  		itemPropertyDescriptors.add
  			(createItemPropertyDescriptor
  				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
  				 getResourceLocator(),
  				 getString("_UI_FMUComponent_parameters_feature"),
  				 getString("_UI_PropertyDescriptor_description", "_UI_FMUComponent_parameters_feature", "_UI_FMUComponent_type"),
  				 ComponentsPackage.Literals.FMU_COMPONENT__PARAMETERS,
  				 true,
  				 false,
  				 true,
  				 null,
  				 null,
  				 null));
  	}
  
  	/**
  	 * This adds a property descriptor for the Fmu feature.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	protected void addFmuPropertyDescriptor(Object object) {
  		itemPropertyDescriptors.add
  			(createItemPropertyDescriptor
  				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
  				 getResourceLocator(),
  				 getString("_UI_FMUComponent_fmu_feature"),
  				 getString("_UI_PropertyDescriptor_description", "_UI_FMUComponent_fmu_feature", "_UI_FMUComponent_type"),
  				 ComponentsPackage.Literals.FMU_COMPONENT__FMU,
  				 true,
  				 false,
  				 false,
  				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
  				 null,
  				 null));
  	}
  
  	/**
  	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
  	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
  	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
  		if (childrenFeatures == null) {
  			super.getChildrenFeatures(object);
  			childrenFeatures.add(ComponentsPackage.Literals.COMPONENT__INPUTS);
  			childrenFeatures.add(ComponentsPackage.Literals.COMPONENT__OUTPUTS);
  			childrenFeatures.add(ComponentsPackage.Literals.COMPONENT__VARIABLES);
  		}
  		return childrenFeatures;
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	protected EStructuralFeature getChildFeature(Object object, Object child) {
  		// Check the type of the specified child object and return the proper feature to use for
  		// adding (see {@link AddCommand}) it as a child.
  
  		return super.getChildFeature(object, child);
  	}
  
  	/**
  	 * This returns FMUComponent.gif.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public Object getImage(Object object) {
  		return overlayImage(object, getResourceLocator().getImage("full/obj16/FMUComponent"));
  	}
  
  	/**
  	 * This returns the label text for the adapted class.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public String getText(Object object) {
  		String label = ((FMUComponent)object).getName();
  		return label == null || label.length() == 0 ?
  			getString("_UI_FMUComponent_type") :
  			getString("_UI_FMUComponent_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(FMUComponent.class)) {
  			case ComponentsPackage.FMU_COMPONENT__NAME:
  			case ComponentsPackage.FMU_COMPONENT__PATH:
  			case ComponentsPackage.FMU_COMPONENT__FMU:
  				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
  				return;
  			case ComponentsPackage.FMU_COMPONENT__INPUTS:
  			case ComponentsPackage.FMU_COMPONENT__OUTPUTS:
  			case ComponentsPackage.FMU_COMPONENT__VARIABLES:
  				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
  				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);
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__INPUTS,
  				 ComponentsFactory.eINSTANCE.createFMUPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__INPUTS,
  				 ComponentsFactory.eINSTANCE.createEventBPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__INPUTS,
  				 ComponentsFactory.eINSTANCE.createDisplayPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__OUTPUTS,
  				 ComponentsFactory.eINSTANCE.createFMUPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__OUTPUTS,
  				 ComponentsFactory.eINSTANCE.createEventBPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__OUTPUTS,
  				 ComponentsFactory.eINSTANCE.createDisplayPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createFMUVariable()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createEventBVariable()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createFMUParameter()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createFMUPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createEventBPort()));
  
  		newChildDescriptors.add
  			(createChildParameter
  				(ComponentsPackage.Literals.COMPONENT__VARIABLES,
  				 ComponentsFactory.eINSTANCE.createDisplayPort()));
  	}
  
  	/**
  	 * 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 == ComponentsPackage.Literals.COMPONENT__INPUTS ||
  			childFeature == ComponentsPackage.Literals.COMPONENT__OUTPUTS ||
  			childFeature == ComponentsPackage.Literals.COMPONENT__VARIABLES;
  
  