use of org.eclipse.jface.wizard.WizardDialog 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();
}
use of org.eclipse.jface.wizard.WizardDialog 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();
}
use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.
the class CreateWorkflowGroupAction method run.
/**
* {@inheritDoc}
*/
@Override
public void run() {
NewWorkflowGroupProjectWizard wizard = new NewWorkflowGroupProjectWizard();
IWorkbench workbench = PlatformUI.getWorkbench();
ISelection selection = workbench.getActiveWorkbenchWindow().getSelectionService().getSelection();
if (selection instanceof IStructuredSelection) {
wizard.init(workbench, (IStructuredSelection) selection);
}
WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
dialog.open();
}
use of org.eclipse.jface.wizard.WizardDialog 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();
}
use of org.eclipse.jface.wizard.WizardDialog in project eclipse-pmd by acanda.
the class PMDPropertyPageController method addRuleSetConfiguration.
public void addRuleSetConfiguration(final Shell shell) {
final AddRuleSetConfigurationWizard wizard = new AddRuleSetConfigurationWizard(project);
final WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.setPageSize(300, SWT.DEFAULT);
final int result = dialog.open();
if (result == Window.OK && wizard.getRuleSetModel() != null) {
final RuleSetViewModel viewModel = toViewModel(wizard.getRuleSetModel(), project);
model.addRuleSet(viewModel);
final HashSet<RuleSetViewModel> activeConfigs = new HashSet<>(model.getActiveRuleSets());
activeConfigs.add(viewModel);
model.setActiveRuleSets(activeConfigs);
}
}
Aggregations