Search in sources :

Example 6 with WizardPage

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

the class OptionTemplateSection method flagMissingRequiredOption.

/**
 * Locates the page that this option is presented in and flags that the
 * option is required and is currently not set. The flagging is done by
 * setting the page incomplete and setting the error message that uses
 * option's message label.
 *
 * @param option
 *            the option that is required and currently not set
 */
protected void flagMissingRequiredOption(TemplateOption option) {
    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 = NLS.bind(PDEUIMessages.OptionTemplateSection_mustBeSet, option.getMessageLabel());
        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)

Example 7 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project webtools.sourceediting by eclipse.

the class NewModelWizard method performFinish.

public boolean performFinish() {
    boolean result = true;
    WizardPage currentPage = (WizardPage) getContainer().getCurrentPage();
    if (currentPage != null) {
        result = currentPage.isPageComplete();
    }
    return result;
}
Also used : WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 8 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project webtools.sourceediting by eclipse.

the class NewXMLWizard method getNextPage.

public IWizardPage getNextPage(IWizardPage currentPage) {
    WizardPage nextPage = null;
    if (currentPage == startPage) {
        nextPage = newFilePage;
    } else if (currentPage == newFilePage) {
        if (generator.getGrammarURI() == null)
            nextPage = fCreateXMLFromWizardPage;
        else
            nextPage = selectRootElementPage;
    } else if (currentPage == fCreateXMLFromWizardPage) {
        if (getCreateMode() == CREATE_FROM_SCRATCH) {
            nextPage = fNewXMLTemplatesWizardPage;
        } else if (generator.getGrammarURI() == null) {
            nextPage = selectGrammarFilePage;
        } else {
            nextPage = selectRootElementPage;
        }
    } else if (currentPage == selectGrammarFilePage) {
        nextPage = selectRootElementPage;
    }
    return nextPage;
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 9 with WizardPage

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

the class ImportYSSLandingWizard method addPages.

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

        @Override
        public void createControl(Composite parent) {
            setTitle("Install YSS Landing");
            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("The 'YSS Landing' project will be imported to your workspace. This project " + "is useful for demo purposes and runs against the simulation example included " + "in the Yamcs repository.\n\n" + "If there is already a project named \"" + InstallYSSLandingAction.PROJECT_NAME + "\" in your workspace, the import will fail. " + "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 10 with WizardPage

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

the class AbstractNativeToolWizard method updateErrorMessage.

void updateErrorMessage() {
    WizardPage currentPage = (WizardPage) getStartingPage();
    if (isNativeClientHomeRequired()) {
        String clientHomeId = getSettings().getDataSourceContainer().getConnectionConfiguration().getClientHomeId();
        List<DBPNativeClientLocation> nativeClientLocations = getSettings().getDataSourceContainer().getDriver().getNativeClientLocations();
        if (CommonUtils.isEmpty(clientHomeId)) {
            if (nativeClientLocations != null && !nativeClientLocations.isEmpty()) {
                settings.setClientHome(nativeClientLocations.get(0));
            } else {
                settings.setClientHome(null);
            }
            if (settings.getClientHome() == null) {
                currentPage.setErrorMessage(TaskNativeUIMessages.tools_wizard_message_no_client_home);
                getContainer().updateMessage();
                return;
            }
        } else {
            DBPNativeClientLocation clientHome = DBUtils.findObject(nativeClientLocations, clientHomeId);
            if (clientHome == null) {
                clientHome = getSettings().findNativeClientHome(clientHomeId);
            }
            if (clientHome == null) {
                // Make local client home from location
                clientHome = new LocalNativeClientLocation(clientHomeId, clientHomeId);
            }
            settings.setClientHome(clientHome);
        }
        if (settings.getClientHome() == null) {
            currentPage.setErrorMessage(NLS.bind(TaskNativeUIMessages.tools_wizard_message_client_home_not_found, clientHomeId));
        } else {
            currentPage.setErrorMessage(null);
        }
        getContainer().updateMessage();
    }
}
Also used : DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) WizardPage(org.eclipse.jface.wizard.WizardPage) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

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