blob: 8af70989c8300f9edb48ce8763800baef4fd6f6b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2007 Boeing.
* 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:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.Import;
import java.io.File;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Branch;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
/**
* @author Robert A. Fisher
* @author Jeff C. Phillips
*/
public class ImportMetaWizard extends Wizard implements IImportWizard {
private ImportMetaPage mainPage;
private IStructuredSelection selection;
/**
*
*/
public ImportMetaWizard() {
super();
setWindowTitle("OSEE Types Import Wizard");
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
try {
Branch branch = mainPage.getSelectedBranch();
File file = mainPage.getImportFile();
Jobs.startJob(new ImportMetaJob(file, branch));
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, "OSEE Import Error", ex);
}
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) {
this.selection = selection;
}
/**
* (non-Javadoc) Method declared on Wizard.
*/
@Override
public void addPages() {
mainPage = new ImportMetaPage(selection);
mainPage.setTitle("Import OSEE Types");
mainPage.setDescription("Import OSEE Types");
addPage(mainPage);
}
}