Example usage for org.eclipse.jface.dialogs IMessageProvider NONE

List of usage examples for org.eclipse.jface.dialogs IMessageProvider NONE

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IMessageProvider NONE.

Prototype

int NONE

To view the source code for org.eclipse.jface.dialogs IMessageProvider NONE.

Click Source Link

Document

Constant for a regular message (value 0).

Usage

From source file:cn.dockerfoundry.ide.eclipse.server.ui.internal.editor.DockerFoundryApplicationsEditorPage.java

License:Open Source License

protected void setErrorInPage(String message) {
    if (message == null) {
        setMessage(null, IMessageProvider.NONE);
    } else {//  w  w w . ja  va2s.co  m
        setMessage(message, IMessageProvider.ERROR);
    }
}

From source file:cn.dockerfoundry.ide.eclipse.server.ui.internal.editor.DockerFoundryApplicationsEditorPage.java

License:Open Source License

protected void setMessageInPage(IStatus status) {
    String message = status.getMessage();
    int providerStatus = IMessageProvider.NONE;
    switch (status.getSeverity()) {
    case IStatus.INFO:
        providerStatus = IMessageProvider.INFORMATION;
        break;//from ww  w  . j  ava 2 s.c  om
    case IStatus.WARNING:
        providerStatus = IMessageProvider.WARNING;
        break;
    }

    setMessage(message, providerStatus);
}

From source file:com.aptana.formatter.ui.util.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 *//*w  w w.ja  v a 2s  . co  m*/
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        if (message.length() == 0) {
            message = null;
        }
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.aptana.ide.security.internal.linux.StorageLoginDialog.java

License:Open Source License

protected boolean validatePassword() {
    String password1 = password.getText();
    if ((password1 == null) || (password1.length() == 0)) {
        setMessage(Messages.messageEmptyPassword, IMessageProvider.ERROR);
        return false;
    }//from   w  w w  .j a  v a2  s .  c om
    if (confirm != null) {
        String password2 = confirm.getText();
        if (!password1.equals(password2)) {
            setMessage(Messages.messageNoMatch, IMessageProvider.WARNING);
            return false;
        }
    }
    setMessage("", IMessageProvider.NONE); //$NON-NLS-1$
    return true;
}

From source file:com.aptana.internal.ui.text.spelling.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 * /*  w ww.  java 2 s.  c  om*/
 * @param page
 *            the dialog page
 * @param status
 *            the status to apply
 */
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    if ((message != null) && (message.length() == 0)) {
        message = null;
    }
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.caucho.resin.eclipse.ResinServerWizardFragment.java

License:Open Source License

private void validate() {
    IStatus status = getResinServer().getRuntimeDelegate().validate();

    if (status != null && status.isOK()) {
        _wizard.update();//from  w w w .  j a va 2  s  . c  o m
        _wizard.setMessage(null, IMessageProvider.NONE);
    } else {
        _wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    }
}

From source file:com.centurylink.mdw.plugin.server.ServiceMixRuntimeWizardFragment.java

License:Apache License

protected boolean validate(IWizardHandle wizard) {
    if (runtime == null) {
        wizard.setMessage("", IMessageProvider.ERROR);
        return false;
    }// w  ww.  j  a v  a 2 s.c  o m

    IStatus status = runtime.validate();
    if (status == null || status.isOK())
        wizard.setMessage(null, IMessageProvider.NONE);
    else if (status.getSeverity() == IStatus.WARNING)
        wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
    else
        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    wizard.update();

    return status == null || status.isOK();
}

From source file:com.centurylink.mdw.plugin.server.ServiceMixServerWizardFragment.java

License:Apache License

protected boolean validate(IWizardHandle wizard) {
    if (server == null) {
        wizard.setMessage("", IMessageProvider.ERROR);
        return false;
    }/*  w  ww.ja va 2s  .  c o m*/

    IStatus status = server.validate();
    if (status == null || status.isOK())
        wizard.setMessage(null, IMessageProvider.NONE);
    else if (status.getSeverity() == IStatus.WARNING)
        wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
    else
        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    wizard.update();

    return status == null || status.isOK();
}

From source file:com.cisco.yangide.editor.dialogs.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 *///  w w w.j av a  2  s .  c  o m
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    if (message != null && message.length() == 0) {
        message = null;
    }
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.codesourcery.internal.installer.ui.WizardDialog.java

License:Open Source License

public void updateMessage() {

    if (currentPage == null) {
        return;/*from ww  w . j  av a 2  s.  c  om*/
    }

    pageMessage = currentPage.getMessage();
    if (pageMessage != null && currentPage instanceof IMessageProvider) {
        pageMessageType = ((IMessageProvider) currentPage).getMessageType();
    } else {
        pageMessageType = IMessageProvider.NONE;
    }
    if (pageMessage == null) {
        setMessage(pageDescription);
    } else {
        setMessage(pageMessage, pageMessageType);
    }
    setErrorMessage(currentPage.getErrorMessage());
}