Search in sources :

Example 41 with WizardDialog

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;
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 42 with WizardDialog

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;
}
Also used : Shell(org.eclipse.swt.widgets.Shell) IWorkbenchWizard(org.eclipse.ui.IWorkbenchWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 43 with WizardDialog

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;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IDockerConnection(org.eclipse.linuxtools.docker.core.IDockerConnection) ImageBuild(org.eclipse.linuxtools.internal.docker.ui.wizards.ImageBuild) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 44 with WizardDialog

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;
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 45 with WizardDialog

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();
}
Also used : NodeContainerEditPart(org.knime.workbench.editor2.editparts.NodeContainerEditPart) WorkflowManager(org.knime.core.node.workflow.WorkflowManager) ReconfigureMetaNodeWizard(org.knime.workbench.editor2.meta.ReconfigureMetaNodeWizard) GUIWorkflowCipherPrompt(org.knime.workbench.editor2.editparts.GUIWorkflowCipherPrompt) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)115 ISelection (org.eclipse.jface.viewers.ISelection)26 Shell (org.eclipse.swt.widgets.Shell)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)25 IWorkbench (org.eclipse.ui.IWorkbench)14 IRepositoryNode (org.talend.repository.model.IRepositoryNode)13 RepositoryNode (org.talend.repository.model.RepositoryNode)13 IPath (org.eclipse.core.runtime.IPath)12 IStatus (org.eclipse.core.runtime.IStatus)10 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)10 IFile (org.eclipse.core.resources.IFile)9 Status (org.eclipse.core.runtime.Status)7 PartInitException (org.eclipse.ui.PartInitException)7 ArrayList (java.util.ArrayList)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 Composite (org.eclipse.swt.widgets.Composite)6 CoreException (org.eclipse.core.runtime.CoreException)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 File (java.io.File)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4