use of org.knime.workbench.ui.wizards.project.NewProjectWizard in project knime-core by knime.
the class NewKnimeWorkflowAction method run.
/**
* Invoke the Import wizards selection Wizard.
*/
@Override
public void run() {
if (m_workbenchWindow == null) {
// action has been disposed
return;
}
NewProjectWizard wizard = new NewProjectWizard();
IStructuredSelection selectionToPass;
// get the current workbench selection
ISelection workbenchSelection = m_workbenchWindow.getSelectionService().getSelection();
if (workbenchSelection instanceof IStructuredSelection) {
selectionToPass = (IStructuredSelection) workbenchSelection;
} else {
selectionToPass = StructuredSelection.EMPTY;
}
wizard.init(m_workbenchWindow.getWorkbench(), selectionToPass);
Shell parent = m_workbenchWindow.getShell();
WizardDialog dialog = new WizardDialog(parent, wizard);
dialog.create();
dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
dialog.open();
}
Aggregations