Search in sources :

Example 1 with NewProjectWizard

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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) NewProjectWizard(org.knime.workbench.ui.wizards.project.NewProjectWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Shell (org.eclipse.swt.widgets.Shell)1 NewProjectWizard (org.knime.workbench.ui.wizards.project.NewProjectWizard)1