Example usage for org.eclipse.jface.wizard WizardPage setMessage

List of usage examples for org.eclipse.jface.wizard WizardPage setMessage

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard WizardPage setMessage.

Prototype

public void setMessage(String newMessage) 

Source Link

Document

Sets or clears the message for this page.

Usage

From source file:net.refractions.udig.catalog.internal.wfs.ui.WFSRegistryWizardPage.java

License:Open Source License

@Override
public void setMessage(String newMessage) {
    WizardPage page = (WizardPage) getContainer().getCurrentPage();
    page.setMessage(newMessage);
}

From source file:org.eclipse.emf.ecp.internal.wizards.CheckoutProjectWizard.java

License:Open Source License

@Override
public void addPages() {
    final WizardPage wp = new WizardPage("Checkout") //$NON-NLS-1$
    {//w w w . j  a v a2s . co m

        @Override
        public void createControl(Composite parent) {
            final Composite composite = getCompositeProvider().createUI(parent);

            getCompositeProvider().setListener(new CheckoutProjectChangeListener() {
                @Override
                public void projectNameChanged(String projectName) {
                    validateName(projectName);
                }
            });

            // validate initial project name
            validateName(getCompositeProvider().getProjectName());
            setControl(composite);
        }

        private void validateName(String projectName) {
            if (ECPUtil.getECPProjectManager().getProject(projectName) != null) {
                setPageComplete(false);
                setErrorMessage("A project with name " + projectName + " already exists in the workspace.");
            } else {
                setErrorMessage(null);
                setPageComplete(true);
            }
        }
    };
    addPage(wp);

    wp.setTitle(Messages.CheckoutProjectWizard_PageTitle_CheckoutProject);
    wp.setImageDescriptor(Activator.getImageDescriptor("icons/checkout_project_wiz.png")); //$NON-NLS-1$

    final ECPCheckoutSource checkoutSource = getCompositeProvider().getCheckoutSource();

    final ECPRepository repository = checkoutSource.getRepository();
    if (checkoutSource == repository) {
        wp.setMessage(
                Messages.CheckoutProjectWizard_PageMessage_CheckoutRepositrory + repository.getLabel() + "."); //$NON-NLS-1$
    } else {
        wp.setMessage(Messages.CheckoutProjectWizard_PageMessage_CheckoutProject
                + getCompositeProvider().getUiProvider().getText(checkoutSource)
                + Messages.CheckoutProjectWizard_PageMessage_CheckoutFrom + repository.getLabel() + "."); //$NON-NLS-1$
    }
    setWindowTitle(Messages.CheckoutProjectWizard_Title_Checkout);
}

From source file:org.eclipse.emf.ecp.internal.wizards.CreateProjectWizard.java

License:Open Source License

@Override
public void addPages() {
    super.addPages();
    final List<ECPProvider> providers = new ArrayList<ECPProvider>();
    for (final ECPProvider provider : ECPUtil.getECPProviderRegistry().getProviders()) {
        if (provider.hasCreateProjectWithoutRepositorySupport()) {
            providers.add(provider);// w w  w. j  a  va2  s  .c om
        }
    }
    final WizardPage wp = new WizardPage("CreateProject") //$NON-NLS-1$
    {

        @Override
        public void createControl(Composite parent) {
            final Composite composite = getCompositeProvider().createUI(parent);
            getCompositeProvider().setListener(new CreateProjectChangeListener() {

                @Override
                public void providerChanged(ECPProvider provider) {
                }

                @Override
                public void projectNameChanged(String projectName) {
                    if (projectName != null && ECPUtil.getECPProjectManager().getProject(projectName) != null) {
                        setErrorMessage(
                                "A project with name " + projectName + " already exists in the workspace.");
                    } else {
                        setErrorMessage(null);
                    }
                }

                @Override
                public void completeStatusChanged(boolean status) {
                    setPageComplete(status);

                }
            });
            setPageComplete(false);
            setControl(composite);
        }
    };
    addPage(wp);
    final String title = Messages.CreateProjectWizard_PageTitle_CreateProject;
    String message = Messages.CreateProjectWizard_PageMessage_SelectProviderAndSetName;
    if (providers.size() == 1) {
        message = Messages.CreateProjectWizard_PageMessage_SetProjectName;
    }
    wp.setTitle(title);
    wp.setImageDescriptor(Activator.getImageDescriptor("icons/checkout_project_wiz.png")); //$NON-NLS-1$
    wp.setMessage(message);
    setWindowTitle(title);
}

From source file:org.kalypso.contribs.eclipse.jface.wizard.WizardPageUtilities.java

License:Open Source License

/**
 * Appends a warning message to the existing ones. If none exists, a new one is set.
 * /*from ww  w . ja v  a2  s  .c  o  m*/
 * @param message
 *          The warning that should be appended.
 * @param page
 *          The wizard page, which should display the warning.
 */
public static void appendWarning(final String message, final WizardPage page) {
    /* If the message should be resetted ... */
    if (message == null || "".equals(message)) //$NON-NLS-1$
    {
        /* ... do it! */
        page.setMessage(null);
        return;
    }

    if (page.getMessage() == null)
        page.setMessage(message, IMessageProvider.WARNING);
    else
        page.setMessage(page.getMessage() + "\n" + message, IMessageProvider.WARNING);
}

From source file:org.sonarlint.eclipse.ui.internal.server.wizard.ServerConnectionWizard.java

License:Open Source License

private boolean tryLoadOrganizations(WizardPage currentPage) {
    currentPage.setMessage(null);
    try {//from w w  w  . j  a  v a 2 s.  c  o  m
        getContainer().run(true, true, new IRunnableWithProgress() {

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    TextSearchIndex<RemoteOrganization> organizationsIndex = Server.getOrganizationsIndex(
                            model.getServerUrl(), model.getUsername(), model.getPassword(), monitor);
                    model.setOrganizationsIndex(organizationsIndex);
                } catch (UnsupportedServerException e) {
                    model.setOrganizationsIndex(null);
                } finally {
                    monitor.done();
                }
            }
        });
    } catch (InvocationTargetException e) {
        SonarLintLogger.get().debug("Unable to download organizations", e.getCause());
        currentPage.setMessage(e.getCause().getMessage(), IMessageProvider.ERROR);
        model.setOrganizationsIndex(null);
        return false;
    } catch (InterruptedException e) {
        model.setOrganizationsIndex(null);
        return false;
    }
    return true;
}