/*******************************************************************************
* Copyright (c) 2012 Wind River Systems, Inc. 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:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.tcf.te.tcf.ui.wizards;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.wizards.pages.PeerImportWizardPage;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
/**
* PeerImportWizard
*/
public class PeerImportWizard extends Wizard implements IImportWizard {
private String IMPORT_DIALOG_SETTINGS = "PeerImport"; //$NON-NLS-1$
/**
* Constructor.
*/
public PeerImportWizard() {
super();
UIPlugin plugin = UIPlugin.getDefault();
IDialogSettings workbenchSettings = plugin.getDialogSettings();
IDialogSettings section = workbenchSettings.getSection(IMPORT_DIALOG_SETTINGS);
if (section == null) {
section = workbenchSettings.addNewSection(IMPORT_DIALOG_SETTINGS);
}
setDialogSettings(section);
}
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@Override
public void addPages() {
IWizardPage page = new PeerImportWizardPage();
addPage(page);
}
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
return ((PeerImportWizardPage)getStartingPage()).finish();
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(Messages.PeerImportWizard_title);
setNeedsProgressMonitor(true);
}
}