Search in sources :

Example 1 with WorkflowExportWizard

use of org.knime.workbench.ui.wizards.export.WorkflowExportWizard in project knime-core by knime.

the class ExportKnimeWorkflowAction method run.

/**
 * Invoke the Import wizards selection Wizard.
 */
@Override
public void run() {
    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (workbenchWindow == null) {
        // action has been disposed
        return;
    }
    WorkflowExportWizard wizard = new WorkflowExportWizard();
    IStructuredSelection selectionToPass;
    // get the current workbench selection
    ISelection workbenchSelection = workbenchWindow.getSelectionService().getSelection();
    if (workbenchSelection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) workbenchSelection;
    } else {
        selectionToPass = StructuredSelection.EMPTY;
    }
    wizard.init(workbenchWindow.getWorkbench(), selectionToPass);
    Shell parent = 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 : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) Shell(org.eclipse.swt.widgets.Shell) WorkflowExportWizard(org.knime.workbench.ui.wizards.export.WorkflowExportWizard) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) 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 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 WorkflowExportWizard (org.knime.workbench.ui.wizards.export.WorkflowExportWizard)1