blob: 57e92137488cfd2ad31fe70793d2fc5ad17887de [file] [log] [blame]
/**
*/
package org.eclipse.osbp.ecview.core.extension.model.extension.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.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
import org.eclipse.osbp.ecview.core.common.model.core.provider.YEmbeddableItemProvider;
import org.eclipse.osbp.ecview.core.extension.model.datatypes.ExtDatatypesFactory;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
import org.eclipse.osbp.ecview.core.extension.model.extension.YFilteringComponent;
/**
* This is the item provider adapter for a {@link org.eclipse.osbp.ecview.core.extension.model.extension.YFilteringComponent} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class YFilteringComponentItemProvider extends YEmbeddableItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public YFilteringComponentItemProvider(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);
addSpacingPropertyDescriptor(object);
addMarginPropertyDescriptor(object);
addTypePropertyDescriptor(object);
addEmfNsURIPropertyDescriptor(object);
addTypeQualifiedNamePropertyDescriptor(object);
addApplyFilterPropertyDescriptor(object);
addResetFilterPropertyDescriptor(object);
addFilterPropertyDescriptor(object);
addSelectionBeanSlotNamePropertyDescriptor(object);
addFilterColsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Spacing feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSpacingPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YSpacingable_spacing_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YSpacingable_spacing_feature", "_UI_YSpacingable_type"),
CoreModelPackage.Literals.YSPACINGABLE__SPACING,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Margin feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMarginPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YMarginable_margin_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YMarginable_margin_feature", "_UI_YMarginable_type"),
CoreModelPackage.Literals.YMARGINABLE__MARGIN,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_type_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_type_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__TYPE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Emf Ns URI feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addEmfNsURIPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_emfNsURI_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_emfNsURI_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__EMF_NS_URI,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Type Qualified Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTypeQualifiedNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_typeQualifiedName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_typeQualifiedName_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__TYPE_QUALIFIED_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Apply Filter feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addApplyFilterPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_applyFilter_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_applyFilter_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__APPLY_FILTER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Reset Filter feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addResetFilterPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_resetFilter_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_resetFilter_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__RESET_FILTER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Filter feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addFilterPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_filter_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_filter_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__FILTER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Selection Bean Slot Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSelectionBeanSlotNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_selectionBeanSlotName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_selectionBeanSlotName_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__SELECTION_BEAN_SLOT_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Filter Cols feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addFilterColsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YFilteringComponent_filterCols_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YFilteringComponent_filterCols_feature", "_UI_YFilteringComponent_type"),
ExtensionModelPackage.Literals.YFILTERING_COMPONENT__FILTER_COLS,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_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(ExtensionModelPackage.Literals.YFILTERING_COMPONENT__FILTER_DESCRIPTORS);
childrenFeatures.add(ExtensionModelPackage.Literals.YFILTERING_COMPONENT__TABLE_DESCRIPTORS);
}
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 YFilteringComponent.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/YFilteringComponent"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((YFilteringComponent)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_YFilteringComponent_type") :
getString("_UI_YFilteringComponent_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(YFilteringComponent.class)) {
case ExtensionModelPackage.YFILTERING_COMPONENT__SPACING:
case ExtensionModelPackage.YFILTERING_COMPONENT__MARGIN:
case ExtensionModelPackage.YFILTERING_COMPONENT__TYPE:
case ExtensionModelPackage.YFILTERING_COMPONENT__EMF_NS_URI:
case ExtensionModelPackage.YFILTERING_COMPONENT__TYPE_QUALIFIED_NAME:
case ExtensionModelPackage.YFILTERING_COMPONENT__APPLY_FILTER:
case ExtensionModelPackage.YFILTERING_COMPONENT__RESET_FILTER:
case ExtensionModelPackage.YFILTERING_COMPONENT__FILTER:
case ExtensionModelPackage.YFILTERING_COMPONENT__SELECTION_BEAN_SLOT_NAME:
case ExtensionModelPackage.YFILTERING_COMPONENT__FILTER_COLS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case ExtensionModelPackage.YFILTERING_COMPONENT__FILTER_DESCRIPTORS:
case ExtensionModelPackage.YFILTERING_COMPONENT__TABLE_DESCRIPTORS:
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
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYTextDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYTextAreaDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYNumericDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYDecimalDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYTableDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYCheckBoxDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYComboBoxDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYListDataType()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYOptionsGroupDataType()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYBrowserDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYDateTimeDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYTreeDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYProgressBarDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYTabSheetDatatype()));
newChildDescriptors.add
(createChildParameter
(CoreModelPackage.Literals.YEMBEDDABLE__ORPHAN_DATATYPES,
ExtDatatypesFactory.eINSTANCE.createYMasterDetailDatatype()));
newChildDescriptors.add
(createChildParameter
(ExtensionModelPackage.Literals.YFILTERING_COMPONENT__FILTER_DESCRIPTORS,
ExtensionModelFactory.eINSTANCE.createYFilterDescriptor()));
newChildDescriptors.add
(createChildParameter
(ExtensionModelPackage.Literals.YFILTERING_COMPONENT__TABLE_DESCRIPTORS,
ExtensionModelFactory.eINSTANCE.createYFilterTableDescriptor()));
}
}