| /** |
| * ******************************************************************************* |
| * 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: |
| * Pierre Allard - initial API and implementation |
| * Regent L'Archeveque |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| * ******************************************************************************* |
| */ |
| package org.eclipse.apogy.core.environment.earth.orbit.ui.provider; |
| |
| |
| import java.util.Collection; |
| import java.util.List; |
| |
| import org.eclipse.apogy.core.environment.earth.orbit.ui.ApogyCoreEnvironmentEarthOrbitUIFactory; |
| import org.eclipse.apogy.core.environment.earth.orbit.ui.ApogyCoreEnvironmentEarthOrbitUIPackage; |
| import org.eclipse.apogy.core.environment.earth.orbit.ui.SelectedVisibilityPassesWorldWindLayer; |
| |
| import org.eclipse.apogy.core.environment.earth.ui.ApogyEarthEnvironmentUIPackage; |
| |
| import org.eclipse.apogy.core.environment.earth.ui.provider.CompositeWorldWindLayerItemProvider; |
| |
| 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; |
| |
| /** |
| * This is the item provider adapter for a {@link org.eclipse.apogy.core.environment.earth.orbit.ui.SelectedVisibilityPassesWorldWindLayer} object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public abstract class SelectedVisibilityPassesWorldWindLayerItemProvider extends CompositeWorldWindLayerItemProvider { |
| /** |
| * This constructs an instance from a factory and a notifier. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SelectedVisibilityPassesWorldWindLayerItemProvider(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); |
| |
| addLockSelectionPropertyDescriptor(object); |
| addAllowZeroSizeSelectionPropertyDescriptor(object); |
| addColorPropertyDescriptor(object); |
| addDrawFillLinesPropertyDescriptor(object); |
| } |
| return itemPropertyDescriptors; |
| } |
| |
| /** |
| * This adds a property descriptor for the Lock Selection feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addLockSelectionPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_SelectionBasedWorldWindLayer_lockSelection_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_SelectionBasedWorldWindLayer_lockSelection_feature", "_UI_SelectionBasedWorldWindLayer_type"), |
| ApogyEarthEnvironmentUIPackage.Literals.SELECTION_BASED_WORLD_WIND_LAYER__LOCK_SELECTION, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Allow Zero Size Selection feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addAllowZeroSizeSelectionPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_SelectionBasedWorldWindLayer_allowZeroSizeSelection_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_SelectionBasedWorldWindLayer_allowZeroSizeSelection_feature", "_UI_SelectionBasedWorldWindLayer_type"), |
| ApogyEarthEnvironmentUIPackage.Literals.SELECTION_BASED_WORLD_WIND_LAYER__ALLOW_ZERO_SIZE_SELECTION, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Color feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addColorPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_SelectedVisibilityPassesWorldWindLayer_color_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_SelectedVisibilityPassesWorldWindLayer_color_feature", "_UI_SelectedVisibilityPassesWorldWindLayer_type"), |
| ApogyCoreEnvironmentEarthOrbitUIPackage.Literals.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__COLOR, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Draw Fill Lines feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addDrawFillLinesPropertyDescriptor(Object object) { |
| itemPropertyDescriptors.add |
| (createItemPropertyDescriptor |
| (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_SelectedVisibilityPassesWorldWindLayer_drawFillLines_feature"), |
| getString("_UI_PropertyDescriptor_description", "_UI_SelectedVisibilityPassesWorldWindLayer_drawFillLines_feature", "_UI_SelectedVisibilityPassesWorldWindLayer_type"), |
| ApogyCoreEnvironmentEarthOrbitUIPackage.Literals.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__DRAW_FILL_LINES, |
| true, |
| false, |
| false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, |
| null, |
| null)); |
| } |
| |
| /** |
| * This returns SelectedVisibilityPassesWorldWindLayer.gif. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object getImage(Object object) { |
| return overlayImage(object, getResourceLocator().getImage("full/obj16/SelectedVisibilityPassesWorldWindLayer")); |
| } |
| |
| /** |
| * This returns the label text for the adapted class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getText(Object object) { |
| String label = ((SelectedVisibilityPassesWorldWindLayer)object).getName(); |
| return label == null || label.length() == 0 ? |
| getString("_UI_SelectedVisibilityPassesWorldWindLayer_type") : |
| getString("_UI_SelectedVisibilityPassesWorldWindLayer_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(SelectedVisibilityPassesWorldWindLayer.class)) { |
| case ApogyCoreEnvironmentEarthOrbitUIPackage.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__LOCK_SELECTION: |
| case ApogyCoreEnvironmentEarthOrbitUIPackage.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__ALLOW_ZERO_SIZE_SELECTION: |
| case ApogyCoreEnvironmentEarthOrbitUIPackage.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__COLOR: |
| case ApogyCoreEnvironmentEarthOrbitUIPackage.SELECTED_VISIBILITY_PASSES_WORLD_WIND_LAYER__DRAW_FILL_LINES: |
| 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); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createOrbitAnalysisDataSetWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSpacecraftLocationWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSpacecraftOrbitAnalysisWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createEclipsesWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSpacecraftOrbitSegmentsWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createVisibilityPassWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSelectedVisibilityPassesWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createAllVisibilityPassesWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createOrbitModelWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSpacecraftSwathWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createGroundStationWorldWindLayer())); |
| |
| newChildDescriptors.add |
| (createChildParameter |
| (ApogyEarthEnvironmentUIPackage.Literals.COMPOSITE_WORLD_WIND_LAYER__LAYERS, |
| ApogyCoreEnvironmentEarthOrbitUIFactory.eINSTANCE.createSelectedGroundStationsWorldWindLayer())); |
| } |
| |
| } |