use of org.talend.repository.ui.login.NewImportProjectWizard in project tdi-studio-se by Talend.
the class ImportDemoProjectPage method prefromFinish.
public boolean prefromFinish() {
final DemoProjectBean selectPro = this.demoProjectList.get(selectedDemoProjectIndex);
NewImportProjectWizard newPrjWiz = new NewImportProjectWizard();
WizardDialog newProjectDialog = new WizardDialog(getShell(), newPrjWiz);
//$NON-NLS-1$
newProjectDialog.setTitle(Messages.getString("NewImportProjectWizard.windowTitle"));
if (newProjectDialog.open() == Window.OK) {
projectName = newPrjWiz.getName().trim().replace(' ', '_');
// final String demoProjName = selectPro.getProjectName();
//
ProgressDialog progressDialog = new ProgressDialog(getShell()) {
private IProgressMonitor monitorWrap;
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitorWrap = new EventLoopProgressMonitor(monitor);
try {
// }
if (null == selectPro) {
//$NON-NLS-1$
throw new IOException("cannot find selected demo project");
}
ImportProjectsUtilities.importDemoProject(getShell(), projectName, selectPro, monitor);
} catch (Exception e1) {
projectName = null;
throw new InvocationTargetException(e1);
}
monitorWrap.done();
}
};
try {
progressDialog.executeProcess();
} catch (InvocationTargetException e1) {
projectName = null;
MessageBoxExceptionHandler.process(e1.getTargetException(), getShell());
} catch (InterruptedException e1) {
projectName = null;
}
}
return true;
}
Aggregations