Search in sources :

Example 1 with WorkflowImportWizard

use of org.knime.workbench.ui.wizards.imports.WorkflowImportWizard in project knime-core by knime.

the class ImportKnimeWorkflowAction method run.

/**
 * Invoke the Import wizards selection Wizard.
 */
@Override
public void run() {
    WorkflowImportWizard wizard = new WorkflowImportWizard();
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
    IStructuredSelection selectionToPass;
    // get the current workbench selection
    ISelection workbenchSelection = m_workbenchWindow.getSelectionService().getSelection();
    if (workbenchSelection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) workbenchSelection;
        if (selectionToPass.size() == 1) {
            Object o = selectionToPass.getFirstElement();
            if (o instanceof IContainer) {
                wizard.setInitialDestination((IContainer) o);
            }
        }
    }
    dialog.open();
}
Also used : WorkflowImportWizard(org.knime.workbench.ui.wizards.imports.WorkflowImportWizard) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IContainer(org.eclipse.core.resources.IContainer) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

IContainer (org.eclipse.core.resources.IContainer)1 ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 WorkflowImportWizard (org.knime.workbench.ui.wizards.imports.WorkflowImportWizard)1