/*
* This file is part of CloudEclipse.
*
* Copyright (c) 2009 Chris Matthews
*
* CloudEclipse is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CloudEclipse is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CloudEclipse. If not, see <http://www.gnu.org/licenses/>.
*
*/
package ca.uvic.cs.cloud.cloudwizard.exportWizard;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import ca.uvic.cs.cloud.cloudwizard.BuildSettingStoreFactory;
import ca.uvic.cs.cloud.cloudwizard.BuildSettingsStore;
import ca.uvic.cs.cloud.cloudwizard.CloudBuildRunner;
public class ExportWizard extends Wizard implements IImportWizard {
ExportCloudWizardPage page;
ExportCloudWizardPage2 page2;
public ExportWizard() {
super();
//setHelpAvailable(false);
}
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
public boolean performFinish() {
System.out.println("export");
BuildSettingsStore bs = BuildSettingStoreFactory.build(page, page2);
CloudBuildRunner cbr = new CloudBuildRunner(bs);
cbr.setPriority(Job.LONG);
cbr.schedule(); // start as soon as possible
return true;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle("Cloud Export Wizard"); //NON-NLS-1
setNeedsProgressMonitor(true);
page = new ExportCloudWizardPage(selection, "wizardPage1"); //NON-NLS-1
page2 = new ExportCloudWizardPage2(selection, "wizardPage2"); //NON-NLS-1
}
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
public void addPages() {
super.addPages();
addPage(page);
addPage(page2);
}
}