use of org.eclipse.ui.intro.IIntroManager in project knime-core by knime.
the class NewProjectWizardIntroAction method run.
/**
* {@inheritDoc}
*/
@Override
public void run(final IIntroSite site, final Properties params) {
try {
// close the intro page
IIntroManager introManager = PlatformUI.getWorkbench().getIntroManager();
IIntroPart introPart = introManager.getIntro();
if (introPart != null) {
introManager.closeIntro(introPart);
}
if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length == 0) {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
// call static method on NewProjectWizard
AbstractExplorerFileStore workspaceRoot = null;
for (AbstractContentProvider cp : ExplorerMountTable.getMountedContent().values()) {
if (cp.getFileStore("/") instanceof LocalWorkspaceFileStore) {
workspaceRoot = cp.getFileStore("/");
break;
}
}
if (workspaceRoot == null) {
throw new IllegalArgumentException("Could not find workspace");
}
AbstractExplorerFileStore newWorkflow = workspaceRoot.getChild("KNIME_project");
NewWorkflowWizard.createNewWorkflow(newWorkflow, monitor);
} catch (CoreException ce) {
throw new InvocationTargetException(ce);
}
}
});
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations