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();
}
Aggregations