| /******************************************************************************* |
| * 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, |
| * Regent L'Archeveque - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| *******************************************************************************/ |
| package org.eclipse.apogy.core.ui.impl; |
| |
| import org.eclipse.apogy.common.emf.ui.EClassSettings; |
| import org.eclipse.apogy.common.math.ApogyCommonMathFacade; |
| import org.eclipse.apogy.core.ApogyCoreFactory; |
| import org.eclipse.apogy.core.FeatureOfInterest; |
| import org.eclipse.apogy.core.ui.FeatureOfInterestUISettings; |
| import org.eclipse.apogy.core.ui.wizards.FeatureOfInterestWizardPage; |
| import org.eclipse.emf.common.util.BasicEList; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.jface.wizard.WizardPage; |
| |
| public class FeatureOfInterestWizardPagesProviderCustomImpl extends FeatureOfInterestWizardPagesProviderImpl { |
| |
| @Override |
| public EList<WizardPage> instantiateWizardPages(EObject eObject, EClassSettings settings) { |
| EList<WizardPage> list = new BasicEList<>(); |
| list.addAll(super.instantiateWizardPages(eObject, settings)); |
| |
| FeatureOfInterest foi = (FeatureOfInterest) eObject; |
| list.add(new FeatureOfInterestWizardPage(foi)); |
| |
| return list; |
| } |
| |
| public EObject createEObject(EClass eClass, EClassSettings settings) { |
| FeatureOfInterest foi = ApogyCoreFactory.eINSTANCE.createFeatureOfInterest(); |
| foi.setPose(ApogyCommonMathFacade.INSTANCE.createIdentityMatrix4x4()); |
| |
| if (settings instanceof FeatureOfInterestUISettings) { |
| FeatureOfInterestUISettings featureOfInterestUISettings = (FeatureOfInterestUISettings) settings; |
| foi.setName(featureOfInterestUISettings.getName()); |
| } |
| return foi; |
| }; |
| } // FeatureOfInterestWizardPagesProviderImpl |