| /*=============================================================================# |
| # Copyright (c) 2012, 2019 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.GeomTextLayer; |
| |
| |
| /** |
| * This is the item provider adapter for a {@link org.eclipse.statet.rtm.ggplot.GeomTextLayer} object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class GeomTextLayerItemProvider |
| 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 GeomTextLayerItemProvider(final AdapterFactory adapterFactory) { |
| super(adapterFactory, GGPlotPackage.Literals.GEOM_TEXT_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); |
| addSizePropertyDescriptor(object); |
| addColorPropertyDescriptor(object); |
| addFontFamilyPropertyDescriptor(object); |
| addFontFacePropertyDescriptor(object); |
| addHJustPropertyDescriptor(object); |
| addVJustPropertyDescriptor(object); |
| addAnglePropertyDescriptor(object); |
| addAlphaPropertyDescriptor(object); |
| addLabelPropertyDescriptor(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 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 Font Family feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addFontFamilyPropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_TextStyle_fontFamily_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_TextStyle_fontFamily_feature", "_UI_TextStyle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.TEXT_STYLE__FONT_FAMILY, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Font Face feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addFontFacePropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_TextStyle_fontFace_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_TextStyle_fontFace_feature", "_UI_TextStyle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.TEXT_STYLE__FONT_FACE, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the HJust feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addHJustPropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_TextStyle_hJust_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_TextStyle_hJust_feature", "_UI_TextStyle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.TEXT_STYLE__HJUST, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the VJust feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addVJustPropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_TextStyle_vJust_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_TextStyle_vJust_feature", "_UI_TextStyle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.TEXT_STYLE__VJUST, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Angle feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addAnglePropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_TextStyle_angle_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_TextStyle_angle_feature", "_UI_TextStyle_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.TEXT_STYLE__ANGLE, |
| 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 adds a property descriptor for the Label feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addLabelPropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_GeomTextLayer_label_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_GeomTextLayer_label_feature", "_UI_GeomTextLayer_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.GEOM_TEXT_LAYER__LABEL, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Size feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addSizePropertyDescriptor(final Object object) { |
| this.itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_PropSizeProvider_size_feature"), //$NON-NLS-1$ |
| getString("_UI_PropertyDescriptor_description", "_UI_PropSizeProvider_size_feature", "_UI_PropSizeProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| GGPlotPackage.Literals.PROP_SIZE_PROVIDER__SIZE, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This returns GeomTextLayer.gif. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object getImage(final Object object) { |
| return overlayImage(object, getResourceLocator().getImage("full/obj16/GeomTextLayer")); //$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(GeomTextLayer.class)) { |
| case GGPlotPackage.GEOM_TEXT_LAYER__XVAR: |
| case GGPlotPackage.GEOM_TEXT_LAYER__YVAR: |
| case GGPlotPackage.GEOM_TEXT_LAYER__GROUP_VAR: |
| case GGPlotPackage.GEOM_TEXT_LAYER__SIZE: |
| case GGPlotPackage.GEOM_TEXT_LAYER__COLOR: |
| case GGPlotPackage.GEOM_TEXT_LAYER__FONT_FAMILY: |
| case GGPlotPackage.GEOM_TEXT_LAYER__FONT_FACE: |
| case GGPlotPackage.GEOM_TEXT_LAYER__HJUST: |
| case GGPlotPackage.GEOM_TEXT_LAYER__VJUST: |
| case GGPlotPackage.GEOM_TEXT_LAYER__ANGLE: |
| case GGPlotPackage.GEOM_TEXT_LAYER__ALPHA: |
| case GGPlotPackage.GEOM_TEXT_LAYER__LABEL: |
| 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); |
| } |
| |
| } |