Search in sources :

Example 51 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.

the class PluginsPart method doAdd.

void doAdd() {
    PluginSelectionWizard wizard = new PluginSelectionWizard();
    WizardDialog dialog = new WizardDialog(getManagedForm().getForm().getShell(), wizard);
    if (dialog.open() == Window.OK) {
        HeaderClause newPlugin = wizard.getHeader();
        data.add(newPlugin);
        viewer.add(newPlugin);
        markDirty();
    }
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog) HeaderClause(aQute.bnd.build.model.clauses.HeaderClause)

Example 52 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.

the class PluginsPart method doEdit.

void doEdit() {
    HeaderClause header = (HeaderClause) ((IStructuredSelection) viewer.getSelection()).getFirstElement();
    if (header != null) {
        Attrs copyOfProperties = new Attrs(header.getAttribs());
        IConfigurationElement configElem = configElements.get(header.getName());
        PluginEditWizard wizard = new PluginEditWizard(configElem, copyOfProperties);
        WizardDialog dialog = new WizardDialog(getManagedForm().getForm().getShell(), wizard);
        if (dialog.open() == Window.OK && wizard.isChanged()) {
            header.getAttribs().clear();
            header.getAttribs().putAll(copyOfProperties);
            viewer.update(header, null);
            markDirty();
        }
    }
}
Also used : Attrs(aQute.bnd.header.Attrs) HeaderClause(aQute.bnd.build.model.clauses.HeaderClause) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 53 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.

the class GenerateIndexCommandHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    ISelection selection = HandlerUtil.getCurrentSelection(event);
    if (selection instanceof IStructuredSelection) {
        IStructuredSelection structSel = (IStructuredSelection) selection;
        Object element = structSel.getFirstElement();
        if (element != null && element instanceof IContainer) {
            NewIndexWizard wizard = new NewIndexWizard();
            IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
            wizard.init(workbenchWindow.getWorkbench(), structSel);
            WizardDialog dialog = new WizardDialog(workbenchWindow.getShell(), wizard);
            dialog.open();
        }
    }
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IContainer(org.eclipse.core.resources.IContainer) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 54 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project yamcs-studio by yamcs.

the class UpdateHandler method doExecute.

@Override
protected void doExecute(LoadMetadataRepositoryJob job) {
    if (hasNoRepos) {
        MessageDialog.openInformation(null, "Update Yamcs Studio", "Could not check for updates since no repository is configured");
        return;
    }
    UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
    // check for updates
    operation.resolveModal(null);
    if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
        if (UpdateSingleIUWizard.validFor(operation)) {
            // Special case for only updating a single root
            UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
            WizardDialog dialog = new WizardDialog(getShell(), wizard);
            dialog.create();
            dialog.open();
        } else {
            // Open the normal version of the update wizard
            getProvisioningUI().openUpdateWizard(false, operation, job);
        }
    }
}
Also used : UpdateOperation(org.eclipse.equinox.p2.operations.UpdateOperation) UpdateSingleIUWizard(org.eclipse.equinox.internal.p2.ui.dialogs.UpdateSingleIUWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 55 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project yamcs-studio by yamcs.

the class AddNewParameterAction method run.

@Override
public void run() {
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    AddParameterWizard wizard = new AddParameterWizard();
    WizardDialog dialog = new WizardDialog(shell, wizard);
    if (dialog.open() == Window.OK)
        for (ParameterInfo info : wizard.getParameter()) viewer.addParameter(info);
}
Also used : AddParameterWizard(org.yamcs.studio.ui.alphanum.AddParameterWizard) Shell(org.eclipse.swt.widgets.Shell) ParameterInfo(org.yamcs.protobuf.Mdb.ParameterInfo) 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