Search in sources :

Example 1 with ImportFromExchangeWizard

use of org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard in project tdq-studio-se by Talend.

the class ImportFactory method importFromExchange.

/**
 * DOC xqliu Comment method "importFromExchange".
 *
 * @param componet
 * @return
 */
public static void importFromExchange(IEcosComponent componet) throws Exception {
    File file = new File(componet.getInstalledLocation());
    File copiedFile = new File(// $NON-NLS-1$
    System.getProperty("java.io.tmpdir") + File.separator + new Path(componet.getInstalledLocation()).lastSegment());
    // copy the downloaded file out of the workspace
    org.apache.commons.io.FileUtils.copyFile(file, copiedFile);
    Wizard wizard = new ImportFromExchangeWizard(copiedFile.getAbsolutePath());
    WizardDialog dialog = new WizardDialog(null, wizard);
    if (WizardDialog.OK == dialog.open()) {
        ResourceManager.getLibrariesFolder().refreshLocal(IResource.DEPTH_INFINITE, null);
    }
}
Also used : Path(org.eclipse.core.runtime.Path) ImportFromExchangeWizard(org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard) IFile(org.eclipse.core.resources.IFile) File(java.io.File) ImportFromExchangeWizard(org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

File (java.io.File)1 IFile (org.eclipse.core.resources.IFile)1 Path (org.eclipse.core.runtime.Path)1 Wizard (org.eclipse.jface.wizard.Wizard)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 ImportFromExchangeWizard (org.talend.dataprofiler.core.ui.imex.ImportFromExchangeWizard)1