use of org.eclipse.jface.wizard.WizardDialog in project linuxtools by eclipse.
the class CommandUtils method openWizard.
/**
* Opens the given {@link IWizard} and returns <code>true</code> if the user
* finished the operation, <code>false</code> if he cancelled it.
*
* @param wizard
* the wizard to open
* @param shell
* the current {@link Shell}
* @return <code>true</code> if the wizard completed, <code>false</code>
* otherwise.
*/
public static boolean openWizard(final IWizard wizard, final Shell shell, final int width, final int height) {
final WizardDialog wizardDialog = new WizardDialog(shell, wizard);
wizardDialog.setPageSize(width, height);
wizardDialog.create();
return wizardDialog.open() == Window.OK;
}
use of org.eclipse.jface.wizard.WizardDialog in project linuxtools by eclipse.
the class ExportHandler method execute.
@Override
public Object execute(ExecutionEvent event) {
Display.getDefault().syncExec(() -> {
Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
IWorkbenchWizard wizard = new ValgrindExportWizard();
wizard.init(PlatformUI.getWorkbench(), null);
WizardDialog dialog = new WizardDialog(parent, wizard);
dialog.open();
});
return null;
}
use of org.eclipse.jface.wizard.WizardDialog in project linuxtools by eclipse.
the class BuildImageCommandHandler method execute.
@Override
public Object execute(final ExecutionEvent event) {
final ImageBuild wizard = new ImageBuild();
final WizardDialog wizardDialog = new NonModalWizardDialog(HandlerUtil.getActiveShell(event), wizard);
wizardDialog.create();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage activePage = null;
IWorkbenchPart activePart = null;
if (window != null)
activePage = window.getActivePage();
if (activePage != null)
activePart = activePage.getActivePart();
IDockerConnection connection = CommandUtils.getCurrentConnection(activePart);
// connections
if (connection == null) {
connection = DockerConnectionManager.getInstance().getFirstConnection();
}
if (connection == null || !connection.isOpen()) {
// if no active connection, issue error message dialog and return
Display.getDefault().syncExec(() -> MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), // $NON-NLS-1$
WizardMessages.getString("ErrorNoActiveConnection.msg"), // $NON-NLS-1$
WizardMessages.getString("ErrorNoActiveConnection.desc")));
return null;
}
final boolean buildImage = wizardDialog.open() == Window.OK;
if (buildImage) {
performBuildImage(wizard, connection);
}
return null;
}
use of org.eclipse.jface.wizard.WizardDialog in project linuxtools by eclipse.
the class CommandUtils method openWizard.
/**
* Opens the given {@link IWizard} and returns <code>true</code> if the user
* finished the operation, <code>false</code> if he cancelled it.
*
* @param wizard
* the wizard to open
* @param shell
* the current {@link Shell}
* @return <code>true</code> if the wizard completed, <code>false</code>
* otherwise.
*/
public static boolean openWizard(final IWizard wizard, final Shell shell) {
final WizardDialog wizardDialog = new WizardDialog(shell, wizard);
wizardDialog.create();
return wizardDialog.open() == Window.OK;
}
use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.
the class MetaNodeReconfigureAction method runOnNodes.
/**
* {@inheritDoc}
*/
@Override
public void runOnNodes(final NodeContainerEditPart[] nodeParts) {
if (nodeParts.length < 1) {
return;
}
NodeContainerEditPart ep = nodeParts[0];
WorkflowManager metanode = Wrapper.unwrapWFM(ep.getNodeContainer());
if (!metanode.unlock(new GUIWorkflowCipherPrompt())) {
return;
}
ReconfigureMetaNodeWizard wizard = new ReconfigureMetaNodeWizard(ep.getViewer(), metanode);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dlg.create();
dlg.open();
}
Aggregations