| /******************************************************************************* |
| * 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.addons.sensors.fov.ui.wizards; |
| |
| import org.eclipse.apogy.addons.sensors.fov.ui.FieldOfViewEntry3DTool; |
| import org.eclipse.apogy.addons.sensors.fov.ui.composites.FieldOfViewEntry3DToolComposite; |
| import org.eclipse.core.databinding.DataBindingContext; |
| import org.eclipse.jface.wizard.WizardPage; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.layout.GridLayout; |
| import org.eclipse.swt.widgets.Composite; |
| |
| public class FieldOfViewEntry3DToolWizardPage extends WizardPage { |
| private final static String WIZARD_PAGE_ID = "org.eclipse.apogy.addons.sensors.fov.ui.wizards.FieldOfViewEntry3DToolWizardPage"; |
| |
| private final FieldOfViewEntry3DTool fieldOfViewEntry3DTool; |
| private FieldOfViewEntry3DToolComposite fieldOfViewEntry3DToolComposite; |
| |
| private DataBindingContext m_bindingContext; |
| |
| public FieldOfViewEntry3DToolWizardPage(FieldOfViewEntry3DTool fieldOfViewEntry3DTool) { |
| super(WIZARD_PAGE_ID); |
| this.fieldOfViewEntry3DTool = fieldOfViewEntry3DTool; |
| |
| setTitle("Field Of View Entry Tool."); |
| setDescription("Select the Tool Field Of View."); |
| |
| validate(); |
| } |
| |
| @Override |
| public void createControl(Composite parent) { |
| Composite top = new Composite(parent, SWT.None); |
| top.setLayout(new GridLayout(1, false)); |
| |
| this.fieldOfViewEntry3DToolComposite = new FieldOfViewEntry3DToolComposite(top, SWT.NONE); |
| this.fieldOfViewEntry3DToolComposite.setFieldOfViewEntry3DTool(this.fieldOfViewEntry3DTool); |
| |
| setControl(top); |
| |
| // Bindings |
| this.m_bindingContext = initDataBindingsCustom(); |
| } |
| |
| @Override |
| public void dispose() { |
| if (this.m_bindingContext != null) |
| this.m_bindingContext.dispose(); |
| |
| super.dispose(); |
| } |
| |
| protected void validate() { |
| setErrorMessage(null); |
| |
| setPageComplete(getErrorMessage() == null); |
| } |
| |
| private DataBindingContext initDataBindingsCustom() { |
| DataBindingContext bindingContext = new DataBindingContext(); |
| |
| return bindingContext; |
| } |
| |
| } |