blob: 06c4d4e4824a9709e8e2e678462e242900c3bfe3 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2021 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.rtm.ggplot.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.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.ViewerNotification;
import org.eclipse.statet.rtm.ggplot.GGPlotPackage;
import org.eclipse.statet.rtm.ggplot.GeomViolinLayer;
/**
* This is the item provider adapter for a {@link org.eclipse.statet.rtm.ggplot.GeomViolinLayer} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class GeomViolinLayerItemProvider
extends LayerItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public GeomViolinLayerItemProvider(final AdapterFactory adapterFactory) {
super(adapterFactory, GGPlotPackage.Literals.GEOM_VIOLIN_LAYER);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(final Object object) {
if (this.itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addXVarPropertyDescriptor(object);
addYVarPropertyDescriptor(object);
addGroupVarPropertyDescriptor(object);
addLineTypePropertyDescriptor(object);
addColorPropertyDescriptor(object);
addFillPropertyDescriptor(object);
addAlphaPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Group Var feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addGroupVarPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropGroupVarProvider_groupVar_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropGroupVarProvider_groupVar_feature", "_UI_PropGroupVarProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_GROUP_VAR_PROVIDER__GROUP_VAR,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the XVar feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addXVarPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropXVarProvider_xVar_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropXVarProvider_xVar_feature", "_UI_PropXVarProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_XVAR_PROVIDER__XVAR,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the YVar feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addYVarPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropYVarProvider_yVar_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropYVarProvider_yVar_feature", "_UI_PropYVarProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_YVAR_PROVIDER__YVAR,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Line Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addLineTypePropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropLineTypeProvider_lineType_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropLineTypeProvider_lineType_feature", "_UI_PropLineTypeProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_LINE_TYPE_PROVIDER__LINE_TYPE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Color feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addColorPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropColorProvider_color_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropColorProvider_color_feature", "_UI_PropColorProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_COLOR_PROVIDER__COLOR,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Fill feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addFillPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropFillProvider_fill_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropFillProvider_fill_feature", "_UI_PropFillProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_FILL_PROVIDER__FILL,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Alpha feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAlphaPropertyDescriptor(final Object object) {
this.itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PropAlphaProvider_alpha_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_PropAlphaProvider_alpha_feature", "_UI_PropAlphaProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GGPlotPackage.Literals.PROP_ALPHA_PROVIDER__ALPHA,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns GeomViolinLayer.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(final Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/GeomViolinLayer")); //$NON-NLS-1$
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public String getText(final Object object) {
return super.getText(object);
}
/**
* 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(final Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(GeomViolinLayer.class)) {
case GGPlotPackage.GEOM_VIOLIN_LAYER__XVAR:
case GGPlotPackage.GEOM_VIOLIN_LAYER__YVAR:
case GGPlotPackage.GEOM_VIOLIN_LAYER__GROUP_VAR:
case GGPlotPackage.GEOM_VIOLIN_LAYER__LINE_TYPE:
case GGPlotPackage.GEOM_VIOLIN_LAYER__COLOR:
case GGPlotPackage.GEOM_VIOLIN_LAYER__FILL:
case GGPlotPackage.GEOM_VIOLIN_LAYER__ALPHA:
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(final Collection<Object> newChildDescriptors, final Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}