| /** |
| * ******************************************************************************* |
| * Copyright (c) 2017 Timing-Architects Embedded Systems GmbH and others. |
| * 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: |
| * Timing-Architects Embedded Systems GmbH - initial API and implementation |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.generator.ui; |
| |
| import org.eclipse.jface.wizard.IWizardContainer; |
| import org.eclipse.jface.wizard.IWizardPage; |
| import org.eclipse.jface.wizard.WizardDialog; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.widgets.Shell; |
| |
| public class ConfigurationWizardDialog extends WizardDialog { |
| |
| public ConfigurationWizardDialog(Shell parentShell) { |
| super(parentShell, new ConfigurationWizard()); |
| setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE); |
| } |
| |
| // page control for finish button |
| @Override |
| protected void buttonPressed(int buttonId) { |
| super.buttonPressed(buttonId); |
| |
| IWizardPage wizardPage = getCurrentPage(); |
| boolean canFinish = true; |
| if(wizardPage instanceof ImportPage) { |
| // disable finish Button |
| canFinish = false; |
| } |
| ConfigurationWizard wizard = (ConfigurationWizard) getWizard(); |
| wizard.setCanFinish(canFinish); |
| IWizardContainer container = wizard.getContainer(); |
| if(null != container) { |
| wizard.getContainer().updateButtons(); |
| } |
| } |
| |
| } |