use of org.talend.repository.ui.actions.importproject.ImportDemoProjectItemsWizard in project tdi-studio-se by Talend.
the class ImportDemoItemAction method doRun.
@Override
protected void doRun() {
if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
return;
}
// qli modified to fix the bug "6999".
IRepositoryView repositoryView = RepositoryManagerHelper.findRepositoryView();
if (repositoryView != null && repositoryView.getViewer() instanceof TreeViewer) {
((TreeViewer) repositoryView.getViewer()).getTree().setFocus();
}
ISelection selection = this.getSelection();
RepositoryNode rNode = null;
if (toolbarAction) {
if (repositoryView != null) {
selection = repositoryView.getViewer().getSelection();
}
} else if ((selection instanceof IStructuredSelection) && (((IStructuredSelection) selection).getFirstElement() instanceof RepositoryNode)) {
Object o = ((IStructuredSelection) selection).getFirstElement();
if (o instanceof RepositoryNode) {
rNode = (RepositoryNode) o;
}
}
final List<DemoProjectBean> demoProjectList = ImportProjectsUtilities.getAllDemoProjects();
ImportDemoProjectItemsWizard wizard = new ImportDemoProjectItemsWizard(demoProjectList);
wizard.setWindowTitle(IMPORT_DEMO);
wizard.init(PlatformUI.getWorkbench(), (IStructuredSelection) selection);
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, wizard);
dialog.open();
}
Aggregations