Search in sources :

Example 21 with WizardPage

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

the class ImportOPIExamplesWizard method addPages.

@Override
public void addPages() {
    super.addPages();
    setWindowTitle("Install OPI Examples");
    addPage(new WizardPage("OPI Examples") {

        @Override
        public void createControl(Composite parent) {
            setTitle("Install OPI Examples");
            setDescription("Creates a new project with sample OPI displays");
            var container = new Composite(parent, SWT.None);
            container.setLayout(new GridLayout());
            setControl(container);
            var label = new Label(container, SWT.WRAP);
            var gd = new GridData();
            gd.widthHint = 500;
            label.setLayoutData(gd);
            label.setText("OPI Examples will be imported to your workspace. " + NLS.bind("If there is already a project named \"{0}\" in your workspace," + "the import will fail. ", InstallOPIExamplesAction.PROJECT_NAME) + "Please rename or delete it and import again.");
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) WizardPage(org.eclipse.jface.wizard.WizardPage) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Example 22 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project egit by eclipse.

the class RepositoryLocationPage method getWizardPage.

private WizardPage getWizardPage(CloneSourceProvider repositoryImport) {
    WizardPage nextPage;
    nextPage = resolvedWizardPages.get(repositoryImport);
    if (nextPage == null) {
        try {
            nextPage = repositoryImport.getRepositorySearchPage();
        } catch (CoreException e) {
            Activator.error(e.getLocalizedMessage(), e);
        }
        if (nextPage != null) {
            nextPage.setWizard(getWizard());
            resolvedWizardPages.put(repositoryImport, nextPage);
        }
    }
    return nextPage;
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 23 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project ecf by eclipse.

the class RemoteServiceHostExample1Template method addPages.

public void addPages(Wizard wizard) {
    WizardPage page = createPage(0, "org.eclipse.pde.doc.user.rcp_mail");
    page.setTitle("Hello Remote Service Host");
    page.setDescription("This template creates and exports a Hello remote service");
    wizard.addPage(page);
    markPagesAdded();
}
Also used : WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 24 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project gemoc-studio by eclipse.

the class OptionTemplateSection method resetPageState.

/**
 * Resets the current page state by clearing the error message and making
 * the page complete, thereby allowing users to flip to the next page.
 */
protected void resetPageState() {
    if (pages.size() == 0)
        return;
    WizardPage firstPage = pages.get(0).page;
    IWizardContainer container = firstPage.getWizard().getContainer();
    WizardPage currentPage = (WizardPage) container.getCurrentPage();
    currentPage.setErrorMessage(null);
    currentPage.setPageComplete(true);
}
Also used : IWizardContainer(org.eclipse.jface.wizard.IWizardContainer) OptionTemplateWizardPage(org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 25 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project gemoc-studio by eclipse.

the class OptionTemplateSection method flagErrorOnOption.

/**
 * Locates the page that this option is presented in and flags that the
 * option has an error. The flagging is done by
 * setting the page incomplete and setting the error message with the
 * provided message prefixed by the option's message label.
 *
 * @param option
 *            the option that is required and currently not set
 * @param msg
 *            the message indicating the error for the given option
 */
protected void flagErrorOnOption(TemplateOption option, String msg) {
    WizardPage page = null;
    for (int i = 0; i < pages.size(); i++) {
        TemplatePage tpage = pages.get(i);
        ArrayList<TemplateOption> list = tpage.options;
        if (list.contains(option)) {
            page = tpage.page;
            break;
        }
    }
    if (page != null) {
        page.setPageComplete(false);
        String message = option.getMessageLabel() + ": " + msg;
        page.setErrorMessage(message);
    }
}
Also used : OptionTemplateWizardPage(org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage) TemplateOption(org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption)

Aggregations

WizardPage (org.eclipse.jface.wizard.WizardPage)25 IWizardPage (org.eclipse.jface.wizard.IWizardPage)6 Composite (org.eclipse.swt.widgets.Composite)6 Label (org.eclipse.swt.widgets.Label)6 GridData (org.eclipse.swt.layout.GridData)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 OptionTemplateWizardPage (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateWizardPage)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 TemplateOption (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 IWizardContainer (org.eclipse.jface.wizard.IWizardContainer)2 Optional (com.google.common.base.Optional)1 FluentIterable.from (com.google.common.collect.FluentIterable.from)1 Sets.newTreeSet (com.google.common.collect.Sets.newTreeSet)1 Ints (com.google.common.primitives.Ints)1 Inject (com.google.inject.Inject)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections.singletonList (java.util.Collections.singletonList)1