| /** |
| * ******************************************************************************* |
| * Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| * 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: |
| * Regent L'Archeveque - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| * ******************************************************************************* |
| */ |
| package org.eclipse.apogy.core.environment.earth.orbit.planner.provider; |
| |
| |
| import java.util.Collection; |
| import java.util.List; |
| |
| import org.eclipse.apogy.core.environment.earth.orbit.planner.ApogyCoreEnvironmentEarthOrbitPlannerFactory; |
| import org.eclipse.apogy.core.environment.earth.orbit.planner.ApogyCoreEnvironmentEarthOrbitPlannerPackage; |
| import org.eclipse.apogy.core.environment.earth.orbit.planner.ObservationAnalysisPlannerNode; |
| |
| 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.IChildCreationExtender; |
| 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; |
| |
| /** |
| * This is the item provider adapter for a {@link org.eclipse.apogy.core.environment.earth.orbit.planner.ObservationAnalysisPlannerNode} object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class ObservationAnalysisPlannerNodeItemProvider |
| 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 ObservationAnalysisPlannerNodeItemProvider(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); |
| |
| addResultPropertyDescriptor(object); |
| addIdPropertyDescriptor(object); |
| addPassPropertyDescriptor(object); |
| addRootNodePropertyDescriptor(object); |
| addPlannerRootNodePropertyDescriptor(object); |
| addPlannerResultPropertyDescriptor(object); |
| addPlannerPropertyDescriptor(object); |
| addCostPropertyDescriptor(object); |
| addCumulativeCostPropertyDescriptor(object); |
| addFirstLevelNodePropertyDescriptor(object); |
| addLevelPropertyDescriptor(object); |
| addSolutionDurationPropertyDescriptor(object); |
| addPassDurationPropertyDescriptor(object); |
| addTotalPassesDurationPropertyDescriptor(object); |
| } |
| return itemPropertyDescriptors; |
| } |
| |
| /** |
| * This adds a property descriptor for the Result feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addResultPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_result_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_result_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__RESULT, |
| true, |
| false, |
| true, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Id feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIdPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_id_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_id_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__ID, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Pass feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addPassPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_pass_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_pass_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__PASS, |
| true, |
| false, |
| true, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Root Node feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addRootNodePropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_rootNode_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_rootNode_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__ROOT_NODE, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Planner Root Node feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addPlannerRootNodePropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_plannerRootNode_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_plannerRootNode_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__PLANNER_ROOT_NODE, |
| false, |
| false, |
| false, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Planner Result feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addPlannerResultPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_plannerResult_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_plannerResult_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__PLANNER_RESULT, |
| false, |
| false, |
| false, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Planner feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addPlannerPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_planner_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_planner_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__PLANNER, |
| false, |
| false, |
| false, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Cost feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addCostPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_cost_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_cost_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__COST, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Cumulative Cost feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addCumulativeCostPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_cumulativeCost_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_cumulativeCost_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__CUMULATIVE_COST, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the First Level Node feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addFirstLevelNodePropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_firstLevelNode_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_firstLevelNode_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__FIRST_LEVEL_NODE, |
| false, |
| false, |
| false, |
| null, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Level feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addLevelPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_level_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_level_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__LEVEL, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Solution Duration feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addSolutionDurationPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_solutionDuration_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_solutionDuration_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__SOLUTION_DURATION, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Pass Duration feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addPassDurationPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_passDuration_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_passDuration_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__PASS_DURATION, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Total Passes Duration feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addTotalPassesDurationPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_ObservationAnalysisPlannerNode_totalPassesDuration_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_ObservationAnalysisPlannerNode_totalPassesDuration_feature", "_UI_ObservationAnalysisPlannerNode_type"), |
| ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__TOTAL_PASSES_DURATION, |
| false, |
| false, |
| false, |
| ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an |
| * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or |
| * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { |
| if (childrenFeatures == null) { |
| super.getChildrenFeatures(object); |
| childrenFeatures.add(ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__CHILDREN); |
| childrenFeatures.add(ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__STATEFUL_COSTS_MAP_ENTRIES); |
| } |
| 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 ObservationAnalysisPlannerNode.gif. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object getImage(Object object) { |
| return overlayImage(object, getResourceLocator().getImage("full/obj16/ObservationAnalysisPlannerNode")); |
| } |
| |
| /** |
| * This returns the label text for the adapted class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getText(Object object) { |
| String label = ((ObservationAnalysisPlannerNode)object).getId(); |
| return label == null || label.length() == 0 ? |
| getString("_UI_ObservationAnalysisPlannerNode_type") : |
| getString("_UI_ObservationAnalysisPlannerNode_type") + " " + label; |
| } |
| |
| |
| /** |
| * This handles model notifications by calling {@link #updateChildren} to update any cached |
| * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void notifyChanged(Notification notification) { |
| updateChildren(notification); |
| |
| switch (notification.getFeatureID(ObservationAnalysisPlannerNode.class)) { |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__ID: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__ROOT_NODE: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__COST: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__CUMULATIVE_COST: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__LEVEL: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__SOLUTION_DURATION: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__PASS_DURATION: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__TOTAL_PASSES_DURATION: |
| fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); |
| return; |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__CHILDREN: |
| case ApogyCoreEnvironmentEarthOrbitPlannerPackage.OBSERVATION_ANALYSIS_PLANNER_NODE__STATEFUL_COSTS_MAP_ENTRIES: |
| 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 |
| (ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__CHILDREN, |
| ApogyCoreEnvironmentEarthOrbitPlannerFactory.eINSTANCE.createObservationAnalysisPlannerNode())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.OBSERVATION_ANALYSIS_PLANNER_NODE__STATEFUL_COSTS_MAP_ENTRIES, |
| ApogyCoreEnvironmentEarthOrbitPlannerFactory.eINSTANCE.create(ApogyCoreEnvironmentEarthOrbitPlannerPackage.Literals.STATEFUL_COST_FUNCTION_MAP_ENTRY))); |
| } |
| |
| /** |
| * Return the resource locator for this item provider's resources. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ResourceLocator getResourceLocator() { |
| return ((IChildCreationExtender)adapterFactory).getResourceLocator(); |
| } |
| |
| } |