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:de.dentrassi.eclipse.rpm.editor.OverviewPage.java

License:Open Source License

public OverviewPage(final Composite parent) {
    this.toolkit = new FormToolkit(parent.getDisplay());
    parent.addDisposeListener(evt -> this.toolkit.dispose());

    this.form = this.toolkit.createScrolledForm(parent);
    this.form.setText("RPM Lead");
    this.form.setMessage("This page shows the RPM lead information", IMessageProvider.NONE);

    this.toolkit.decorateFormHeading(this.form.getForm());

    this.body = this.form.getBody();
    this.body.setLayout(new GridLayout(2, false));

    this.name = createField("Name");
    this.type = createField("Type");
    this.arch = createField("Architecture");
    this.os = createField("O/S");
    this.version = createField("Lead Version");
    this.sigVersion = createField("Signature Version");

    this.toolkit.paintBordersFor(this.form.getBody());
}

From source file:de.walware.ecommons.ui.components.StatusInfo.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 *//*from w  w  w  . ja  v  a 2  s  .co m*/
public static void applyToStatusLine(final DialogPage page, final IStatus status) {
    String message = status.getMessage();
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(null, 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.isEmpty()) {
            message = null;
        }
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:de.walware.ecommons.ui.components.StatusInfo.java

License:Open Source License

/**
 * Applies the status to the status line of a title area dialog.
 *//*from   w ww. j av  a2 s. co  m*/
public static void applyToStatusLine(final TitleAreaDialog page, final IStatus status) {
    String message = status.getMessage();
    switch (status.getSeverity()) {
    case IStatus.OK:
        if (message.equals("OK") || message.equals(OK_STATUS.getMessage())) { //$NON-NLS-1$
            page.setMessage(null, IMessageProvider.NONE);
        } else {
            page.setMessage(message, IMessageProvider.NONE);
        }
        page.setMessage(!status.getMessage().equals("OK") ? status.getMessage() : null, 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:es.axios.udig.ui.commons.message.InfoMessage.java

License:LGPL

public InfoMessage(final String text, final int type) {

    assert text != null;

    this.text = text;

    switch (type) {
    case IMessageProvider.INFORMATION:
        this.type = Type.INFORMATION;
        break;/*  ww  w .j  av  a2  s . c  om*/
    case IMessageProvider.ERROR:
        this.type = Type.ERROR;
        break;
    case IMessageProvider.NONE:
        this.type = Type.NULL;
        break;
    case IMessageProvider.WARNING:
        this.type = Type.WARNING;
        break;
    }

}

From source file:eu.geclipse.jsdl.ui.internal.pages.sections.AdditionalResourceElementsSection.java

License:Open Source License

private void clearErrorMessage() {
    if (null != getMessage()) {
        if (!getMessage().equals(EMPTY_STRING)) {
            setMessage(EMPTY_STRING, IMessageProvider.NONE);
        }// w  w w .j  a v a2 s.c  o m
    }
}

From source file:eu.geclipse.jsdl.ui.internal.pages.sections.AdditionalResourceElementsSection.java

License:Open Source License

protected void setMessage(final String message, final int type) {

    if (null == getMessage()) {
        this.parentPage.getManagedForm().getForm().setMessage(EMPTY_STRING, IMessageProvider.NONE);
    }/*from   w w w  .j a va 2 s .  c  om*/

    if (!getMessage().equals(message)) {
        this.parentPage.getManagedForm().getForm().setMessage(message, type);
    }

}

From source file:eu.numberfour.n4js.ui.preferences.AbstractN4JSPreferencePage.java

License:Open Source License

/** copied from PropertyAndPreferencePage */
private static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    if (message != null && message.length() == 0) {
        message = null;//from   w  w  w .  ja  va 2s .  c o m
    }
    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:ext.org.eclipse.jdt.internal.ui.refactoring.ExtractConstantWizard.java

License:Open Source License

@Override
protected void addUserInputPages() {

    String message = null;/*from w  w  w . ja v a  2s.  c om*/
    int messageType = IMessageProvider.NONE;
    if (!getExtractConstantRefactoring().selectionAllStaticFinal()) {
        message = RefactoringMessages.ExtractConstantInputPage_selection_refers_to_nonfinal_fields;
        messageType = IMessageProvider.INFORMATION;
    } else {
        message = MESSAGE;
        messageType = IMessageProvider.NONE;
    }

    String[] guessedNames = getExtractConstantRefactoring().guessConstantNames();
    String initialValue = guessedNames.length == 0 ? "" : guessedNames[0]; //$NON-NLS-1$
    addPage(new ExtractConstantInputPage(message, messageType, initialValue, guessedNames));
}

From source file:fr.imag.adele.cadse.si.workspace.uiplatform.swt.SWTUIPlatform.java

License:Apache License

public void setMessage(String newMessage, int newType) {
    if (_pageSite != null) {
        IStatusLineManager statusLine = _pageSite.getActionBars().getStatusLineManager();
        if (statusLine != null) {
            Image newImage = null;
            if (newMessage != null) {
                switch (newType) {
                case IMessageProvider.NONE:
                    break;
                case IMessageProvider.INFORMATION:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
                    break;
                case IMessageProvider.WARNING:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
                    break;
                case IMessageProvider.ERROR:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
                    break;
                }//from   ww w .j a va  2  s  .c o  m
                if (newType == UIPlatform.ERROR) {
                    statusLine.setErrorMessage(newImage, newMessage);

                } else {
                    statusLine.setMessage(newImage, newMessage);
                }
            } else {
                statusLine.setErrorMessage(null);
                statusLine.setMessage(null);
            }
        }
    } else if (dialog != null) {
        if (newMessage != null) {
            if (newType == UIPlatform.ERROR) {
                dialog.setErrorMessage(newMessage);
                IWizardPage page = dialog.getCurrentPage();
                if (page instanceof WizardPage)
                    ((WizardPage) page).setPageComplete(false);
            } else {
                dialog.setMessage(newMessage, newType);
                IWizardPage page = dialog.getCurrentPage();
                if (page instanceof WizardPage)
                    ((WizardPage) page).setPageComplete(true);
            }
        } else {
            dialog.setErrorMessage(null);
            dialog.setMessage(null);

            IWizardPage page = dialog.getCurrentPage();
            if (page instanceof WizardPage)
                ((WizardPage) page).setPageComplete(true);

        }
    }
}

From source file:fr.univnantes.termsuite.ui.dialogs.ConfigureTaggerDialog.java

private void refreshValidState() {
    String validString = TaggerUtil.isValidInstallDir(this.taggerConfig);
    boolean isValid = validString == null;
    if (getButton(IDialogConstants.OK_ID) != null)
        getButton(IDialogConstants.OK_ID).setEnabled(isValid);
    setMessage(isValid ? "Ok" : validString, isValid ? IMessageProvider.NONE : IMessageProvider.ERROR);
    languageViewer.getControl().setVisible(isValid);
    languageLabel.setVisible(isValid);//from   www  .ja v a  2  s. co m
}