diff options
Diffstat (limited to 'prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse')
8 files changed, 1712 insertions, 0 deletions
diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionEditPlugin.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionEditPlugin.java new file mode 100644 index 000000000..2d48f337d --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionEditPlugin.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.provider; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the Expression edit plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public final class ExpressionEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final ExpressionEditPlugin INSTANCE = new ExpressionEditPlugin(); + + /** + * Keep track of the singleton. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ExpressionEditPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse <b>Plugin</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionItemProviderAdapterFactory.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionItemProviderAdapterFactory.java new file mode 100644 index 000000000..40a322653 --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/ExpressionItemProviderAdapterFactory.java @@ -0,0 +1,324 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import org.eclipse.sirius.expression.util.ExpressionAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ExpressionItemProviderAdapterFactory extends ExpressionAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<Object> supportedTypes = new ArrayList<Object>(); + + /** + * This constructs an instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ExpressionItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.SiriusExpressionPackage} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SiriusExpressionPackageItemProvider siriusExpressionPackageItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionPackage}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createSiriusExpressionPackageAdapter() { + if (siriusExpressionPackageItemProvider == null) { + siriusExpressionPackageItemProvider = new SiriusExpressionPackageItemProvider(this); + } + + return siriusExpressionPackageItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.SiriusExpressionDescription} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SiriusExpressionDescriptionItemProvider siriusExpressionDescriptionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionDescription}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createSiriusExpressionDescriptionAdapter() { + if (siriusExpressionDescriptionItemProvider == null) { + siriusExpressionDescriptionItemProvider = new SiriusExpressionDescriptionItemProvider(this); + } + + return siriusExpressionDescriptionItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.SiriusVariable} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SiriusVariableItemProvider siriusVariableItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.SiriusVariable}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createSiriusVariableAdapter() { + if (siriusVariableItemProvider == null) { + siriusVariableItemProvider = new SiriusVariableItemProvider(this); + } + + return siriusVariableItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.SiriusExpressionClass} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SiriusExpressionClassItemProvider siriusExpressionClassItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionClass}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createSiriusExpressionClassAdapter() { + if (siriusExpressionClassItemProvider == null) { + siriusExpressionClassItemProvider = new SiriusExpressionClassItemProvider(this); + } + + return siriusExpressionClassItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.SiriusParameter} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SiriusParameterItemProvider siriusParameterItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.SiriusParameter}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createSiriusParameterAdapter() { + if (siriusParameterItemProvider == null) { + siriusParameterItemProvider = new SiriusParameterItemProvider(this); + } + + return siriusParameterItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.expression.UserDefinedVariable} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected UserDefinedVariableItemProvider userDefinedVariableItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.expression.UserDefinedVariable}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createUserDefinedVariableAdapter() { + if (userDefinedVariableItemProvider == null) { + userDefinedVariableItemProvider = new UserDefinedVariableItemProvider(this); + } + + return userDefinedVariableItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void dispose() { + if (siriusExpressionPackageItemProvider != null) siriusExpressionPackageItemProvider.dispose(); + if (siriusExpressionDescriptionItemProvider != null) siriusExpressionDescriptionItemProvider.dispose(); + if (siriusVariableItemProvider != null) siriusVariableItemProvider.dispose(); + if (siriusExpressionClassItemProvider != null) siriusExpressionClassItemProvider.dispose(); + if (siriusParameterItemProvider != null) siriusParameterItemProvider.dispose(); + if (userDefinedVariableItemProvider != null) userDefinedVariableItemProvider.dispose(); + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionClassItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionClassItemProvider.java new file mode 100644 index 000000000..bea80dfaa --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionClassItemProvider.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.ecore.EStructuralFeature; + +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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import org.eclipse.sirius.expression.ExpressionFactory; +import org.eclipse.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.SiriusExpressionClass; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionClass} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class SiriusExpressionClassItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SiriusExpressionClassItemProvider(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); + + addEClassPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the EClass feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addEClassPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionClass_eClass_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionClass_eClass_feature", "_UI_SiriusExpressionClass_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__ECLASS, + true, + false, + true, + null, + 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(ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__VARIABLES); + childrenFeatures.add(ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__EXPRESSION_DESCRIPTIONS); + } + 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 SiriusExpressionClass.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/SiriusExpressionClass")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_SiriusExpressionClass_type"); //$NON-NLS-1$ + } + + + /** + * 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(SiriusExpressionClass.class)) { + case ExpressionPackage.SIRIUS_EXPRESSION_CLASS__VARIABLES: + case ExpressionPackage.SIRIUS_EXPRESSION_CLASS__EXPRESSION_DESCRIPTIONS: + 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 + (ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__VARIABLES, + ExpressionFactory.eINSTANCE.createSiriusVariable())); + + newChildDescriptors.add + (createChildParameter + (ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__VARIABLES, + ExpressionFactory.eINSTANCE.createUserDefinedVariable())); + + newChildDescriptors.add + (createChildParameter + (ExpressionPackage.Literals.SIRIUS_EXPRESSION_CLASS__EXPRESSION_DESCRIPTIONS, + ExpressionFactory.eINSTANCE.createSiriusExpressionDescription())); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ExpressionEditPlugin.INSTANCE; + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionDescriptionItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionDescriptionItemProvider.java new file mode 100644 index 000000000..67f02360a --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionDescriptionItemProvider.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.ecore.EStructuralFeature; + +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.sirius.expression.ExpressionFactory; +import org.eclipse.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.SiriusExpressionDescription; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionDescription} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class SiriusExpressionDescriptionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SiriusExpressionDescriptionItemProvider(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); + + addLowerBoundPropertyDescriptor(object); + addUpperBoundPropertyDescriptor(object); + addExpressionPropertyDescriptor(object); + addReturnTypePropertyDescriptor(object); + addVariableContainersPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Lower Bound feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addLowerBoundPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionDescription_lowerBound_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionDescription_lowerBound_feature", "_UI_SiriusExpressionDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__LOWER_BOUND, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Upper Bound feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addUpperBoundPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionDescription_upperBound_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionDescription_upperBound_feature", "_UI_SiriusExpressionDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__UPPER_BOUND, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Expression feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionDescription_expression_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionDescription_expression_feature", "_UI_SiriusExpressionDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__EXPRESSION, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Return Type feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addReturnTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionDescription_returnType_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionDescription_returnType_feature", "_UI_SiriusExpressionDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__RETURN_TYPE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Variable Containers feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addVariableContainersPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionDescription_variableContainers_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionDescription_variableContainers_feature", "_UI_SiriusExpressionDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__VARIABLE_CONTAINERS, + true, + false, + true, + null, + 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(ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__PARAMETERS); + } + 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 SiriusExpressionDescription.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/SiriusExpressionDescription")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + SiriusExpressionDescription siriusExpressionDescription = (SiriusExpressionDescription)object; + return getString("_UI_SiriusExpressionDescription_type") + " " + siriusExpressionDescription.getLowerBound(); //$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}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(SiriusExpressionDescription.class)) { + case ExpressionPackage.SIRIUS_EXPRESSION_DESCRIPTION__LOWER_BOUND: + case ExpressionPackage.SIRIUS_EXPRESSION_DESCRIPTION__UPPER_BOUND: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case ExpressionPackage.SIRIUS_EXPRESSION_DESCRIPTION__PARAMETERS: + 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 + (ExpressionPackage.Literals.SIRIUS_EXPRESSION_DESCRIPTION__PARAMETERS, + ExpressionFactory.eINSTANCE.createSiriusParameter())); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ExpressionEditPlugin.INSTANCE; + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionPackageItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionPackageItemProvider.java new file mode 100644 index 000000000..71ba24b31 --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusExpressionPackageItemProvider.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.ecore.EStructuralFeature; + +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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import org.eclipse.sirius.expression.ExpressionFactory; +import org.eclipse.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.SiriusExpressionPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.SiriusExpressionPackage} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class SiriusExpressionPackageItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SiriusExpressionPackageItemProvider(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); + + addEPackagePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the EPackage feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addEPackagePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusExpressionPackage_ePackage_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusExpressionPackage_ePackage_feature", "_UI_SiriusExpressionPackage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_EXPRESSION_PACKAGE__EPACKAGE, + true, + false, + true, + null, + 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(ExpressionPackage.Literals.SIRIUS_EXPRESSION_PACKAGE__EXPRESSION_CLASSES); + } + 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 SiriusExpressionPackage.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/SiriusExpressionPackage")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_SiriusExpressionPackage_type"); //$NON-NLS-1$ + } + + + /** + * 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(SiriusExpressionPackage.class)) { + case ExpressionPackage.SIRIUS_EXPRESSION_PACKAGE__EXPRESSION_CLASSES: + 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 + (ExpressionPackage.Literals.SIRIUS_EXPRESSION_PACKAGE__EXPRESSION_CLASSES, + ExpressionFactory.eINSTANCE.createSiriusExpressionClass())); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ExpressionEditPlugin.INSTANCE; + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusParameterItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusParameterItemProvider.java new file mode 100644 index 000000000..622d2f995 --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusParameterItemProvider.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.SiriusParameter; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.SiriusParameter} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class SiriusParameterItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SiriusParameterItemProvider(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); + + addOptionalPropertyDescriptor(object); + addVariablePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Optional feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addOptionalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusParameter_optional_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusParameter_optional_feature", "_UI_SiriusParameter_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_PARAMETER__OPTIONAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Variable feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addVariablePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusParameter_variable_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusParameter_variable_feature", "_UI_SiriusParameter_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_PARAMETER__VARIABLE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns SiriusParameter.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/SiriusParameter")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + SiriusParameter siriusParameter = (SiriusParameter)object; + return getString("_UI_SiriusParameter_type") + " " + siriusParameter.isOptional(); //$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}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(SiriusParameter.class)) { + case ExpressionPackage.SIRIUS_PARAMETER__OPTIONAL: + 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(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ExpressionEditPlugin.INSTANCE; + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusVariableItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusVariableItemProvider.java new file mode 100644 index 000000000..481537529 --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/SiriusVariableItemProvider.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.SiriusVariable; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.SiriusVariable} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class SiriusVariableItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SiriusVariableItemProvider(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); + addDocumentationPropertyDescriptor(object); + addETypePropertyDescriptor(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_SiriusVariable_name_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusVariable_name_feature", "_UI_SiriusVariable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_VARIABLE__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Documentation feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addDocumentationPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusVariable_documentation_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusVariable_documentation_feature", "_UI_SiriusVariable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_VARIABLE__DOCUMENTATION, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the EType feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addETypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_SiriusVariable_eType_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_SiriusVariable_eType_feature", "_UI_SiriusVariable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.SIRIUS_VARIABLE__ETYPE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns SiriusVariable.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/SiriusVariable")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((SiriusVariable)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_SiriusVariable_type") : //$NON-NLS-1$ + getString("_UI_SiriusVariable_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}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(SiriusVariable.class)) { + case ExpressionPackage.SIRIUS_VARIABLE__NAME: + case ExpressionPackage.SIRIUS_VARIABLE__DOCUMENTATION: + 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(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ExpressionEditPlugin.INSTANCE; + } + +} diff --git a/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/UserDefinedVariableItemProvider.java b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/UserDefinedVariableItemProvider.java new file mode 100644 index 000000000..227dd60f5 --- /dev/null +++ b/prototypes/org.eclipse.sirius.expression.edit/src-gen/org/eclipse/sirius/expression/provider/UserDefinedVariableItemProvider.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2015 Obeo. + * 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.htm + */ +package org.eclipse.sirius.expression.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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import org.eclipse.sirius.expression.ExpressionPackage; +import org.eclipse.sirius.expression.UserDefinedVariable; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.expression.UserDefinedVariable} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class UserDefinedVariableItemProvider extends SiriusVariableItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public UserDefinedVariableItemProvider(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); + + addValueExpressionPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Value Expression feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addValueExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_UserDefinedVariable_valueExpression_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_UserDefinedVariable_valueExpression_feature", "_UI_UserDefinedVariable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ExpressionPackage.Literals.USER_DEFINED_VARIABLE__VALUE_EXPRESSION, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns UserDefinedVariable.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/UserDefinedVariable")); //$NON-NLS-1$ + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((UserDefinedVariable)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_UserDefinedVariable_type") : //$NON-NLS-1$ + getString("_UI_UserDefinedVariable_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}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(UserDefinedVariable.class)) { + case ExpressionPackage.USER_DEFINED_VARIABLE__VALUE_EXPRESSION: + 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(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} |