Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java')
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java255
1 files changed, 255 insertions, 0 deletions
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java
new file mode 100755
index 00000000000..699f0766555
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.edit/src/org/eclipse/papyrus/infra/viewpoints/configuration/provider/PapyrusConfigurationItemProvider.java
@@ -0,0 +1,255 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.viewpoints.configuration.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.ViewerNotification;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationFactory;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
+import org.eclipse.papyrus.infra.viewpoints.configuration.EPackagePropertyDescriptor;
+import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.Iso42010Factory;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.Iso42010Package;
+import org.eclipse.papyrus.infra.viewpoints.iso42010.provider.ArchitectureFrameworkItemProvider;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusConfiguration} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusConfigurationItemProvider
+ extends ArchitectureFrameworkItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusConfigurationItemProvider(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);
+
+ addDefaultStakeholderPropertyDescriptor(object);
+ addMetamodelPropertyDescriptor(object);
+ addCategoriesPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Default Stakeholder feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addDefaultStakeholderPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_defaultStakeholder_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_defaultStakeholder_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__DEFAULT_STAKEHOLDER,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Metamodel feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected void addMetamodelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (new EPackagePropertyDescriptor(createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_metamodel_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_metamodel_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__METAMODEL,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null)));
+ }
+
+ /**
+ * This adds a property descriptor for the Categories feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addCategoriesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusConfiguration_categories_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusConfiguration_categories_feature", "_UI_PapyrusConfiguration_type"),
+ ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES,
+ 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(ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES);
+ }
+ 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 PapyrusConfiguration.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusConfiguration.png"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ @Override
+ public String getText(Object object) {
+ PapyrusConfiguration config = (PapyrusConfiguration) object;
+ if (config.getMetamodel() != null)
+ return "Papyrus Configuration (" + config.getMetamodel().getNsURI() + ")";
+ return "Papyrus Configuration (?)";
+ }
+
+ /**
+ * 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(PapyrusConfiguration.class)) {
+ case ConfigurationPackage.PAPYRUS_CONFIGURATION__CATEGORIES:
+ 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 -->
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_FRAMEWORK__VIEWPOINTS,
+ ConfigurationFactory.eINSTANCE.createPapyrusViewpoint()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (Iso42010Package.Literals.ARCHITECTURE_FRAMEWORK__STAKEHOLDERS,
+ Iso42010Factory.eINSTANCE.createStakeholder()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ConfigurationPackage.Literals.PAPYRUS_CONFIGURATION__CATEGORIES,
+ ConfigurationFactory.eINSTANCE.createCategory()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return ConfigurationEditPlugin.INSTANCE;
+ }
+
+}

Back to the top