// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.repository.ui.wizards.newproject.copyfromeclipse;
import java.util.List;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages;
import org.eclipse.ui.wizards.datatransfer.ZipFileExportWizard;
/**
* DOC guanglong.du class global comment. Detailled comment
*/
public class TalendZipFileExportWizard2 extends ZipFileExportWizard {
private IStructuredSelection selection;
private TalendWizardArchiveFileResourceExportPage2 mainPage;
/**
* Creates a wizard for exporting workspace resources to a zip file.
*/
public TalendZipFileExportWizard2() {
super();
}
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
setWindowTitle(DataTransferMessages.DataTransfer_export);
setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
/*
* (non-Javadoc) Method declared on IWizard.
*/
public void addPages() {
mainPage = new TalendWizardArchiveFileResourceExportPage2(selection);
addPage(mainPage);
}
public boolean performFinish() {
return mainPage.finish();
}
}