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:org.eclipse.birt.report.designer.ui.cubebuilder.page.DatasetSelectionPage.java

License:Open Source License

public void pageActivated() {
    UIUtil.bindHelp(builder.getShell(), IHelpContextIds.CUBE_BUILDER_DATASET_SELECTION_PAGE);
    getContainer().setMessage(Messages.getString("DatasetPage.Container.Title.Message"), //$NON-NLS-1$
            IMessageProvider.NONE);
    builder.setTitleTitle(Messages.getString("DatasetPage.Title.Title")); //$NON-NLS-1$
    builder.setErrorMessage(null);/*w ww . ja v  a2  s  . co  m*/
    builder.setTitleMessage(Messages.getString("DatasetPage.Title.Message")); //$NON-NLS-1$
    load();
}

From source file:org.eclipse.birt.report.designer.ui.cubebuilder.page.GroupsPage.java

License:Open Source License

public void pageActivated() {
    UIUtil.bindHelp(builder.getShell(), IHelpContextIds.CUBE_BUILDER_GROUPS_PAGE);
    getContainer().setMessage(Messages.getString("GroupsPage.Container.Title.Message"), //$NON-NLS-1$
            IMessageProvider.NONE);
    builder.setTitleTitle(Messages.getString("GroupsPage.Title.Title")); //$NON-NLS-1$
    builder.setErrorMessage(null);//from ww  w  .j a v  a2s .c  o m
    builder.setTitleMessage(GROUPPAGE_MESSAGE);
    load();
}

From source file:org.eclipse.birt.report.designer.ui.cubebuilder.page.LinkGroupsPage.java

License:Open Source License

public void pageActivated() {
    UIUtil.bindHelp(builder.getShell(), IHelpContextIds.CUBE_BUILDER_LINK_GROUPS_PAGE);
    getContainer().setMessage(Messages.getString("LinkGroupsPage.Container.Title.Message"), //$NON-NLS-1$
            IMessageProvider.NONE);
    builder.setTitleTitle(Messages.getString("LinkGroupsPage.Title.Title")); //$NON-NLS-1$
    builder.setErrorMessage(null);/*from   w  w w .j  ava  2 s  .co m*/
    builder.setTitleMessage(Messages.getString("LinkGroupsPage.Title.Message")); //$NON-NLS-1$
    load();
}

From source file:org.eclipse.birt.report.designer.ui.dialogs.BaseTitleAreaDialog.java

License:Open Source License

public void setMessage(String msg) {
    this.setMessage(msg, IMessageProvider.NONE);
}

From source file:org.eclipse.birt.report.designer.ui.dialogs.StyleBuilder.java

License:Open Source License

public void setTitleMessage(String newMessage, int newType) {
    Image newImage = null;//from   ww w.  ja v a  2  s .  co m
    if (newMessage != null) {
        switch (newType) {
        case IMessageProvider.NONE:
            break;
        case IMessageProvider.INFORMATION:
            newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_INFO);
            break;
        case IMessageProvider.WARNING:
            newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING);
            break;
        case IMessageProvider.ERROR:
            newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR);
            break;
        }
    }
    showTitleMessage(newMessage, newImage);
}

From source file:org.eclipse.birt.report.designer.ui.preferences.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 * //from   ww w  .ja va 2 s .c  o m
 * @param page
 *            the dialog page
 * @param status
 *            the status to apply
 */
public static void applyToStatusLine(DialogPage page, IStatus status) {
    if (status == null) {
        page.setMessage(null, IMessageProvider.NONE);
        page.setErrorMessage(null);
        return;
    }

    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:org.eclipse.cdt.internal.ui.preferences.PathEntryVariableDialog.java

License:Open Source License

/**
 * Fires validations (variable name first) and updates enabled state for the
 * "Ok" button accordingly.//from w w w .j  a v  a2s . c o m
 */
protected void variableNameModified() {
    // updates and validates the variable name
    variableName = variableNameField.getText().trim();
    validationStatus = IMessageProvider.NONE;
    okButton.setEnabled(validateVariableName() && validateVariableValue());
    nameEntered = true;
}

From source file:org.eclipse.cdt.internal.ui.preferences.PathEntryVariableDialog.java

License:Open Source License

/**
 * Fires validations (variable value first) and updates enabled state for the
 * "Ok" button accordingly./*from   w  ww. j  a va 2  s  . co  m*/
 */
protected void variableValueModified() {
    // updates and validates the variable value
    variableValue = variableValueField.getText().trim();
    validationStatus = IMessageProvider.NONE;
    okButton.setEnabled(validateVariableValue() && validateVariableName());
    locationEntered = true;
}

From source file:org.eclipse.cdt.internal.ui.preferences.PathEntryVariableDialog.java

License:Open Source License

/**
 * Validates the current variable name, and updates this dialog's message.
 * //from   w w w. ja va 2  s  .c  o m
 * @return true if the name is valid, false otherwise
 */
private boolean validateVariableName() {
    boolean allowFinish = false;

    // if the current validationStatus is ERROR, no additional validation applies
    if (validationStatus == IMessageProvider.ERROR)
        return false;

    // assumes everything will be ok
    String message = standardMessage;
    int newValidationStatus = IMessageProvider.NONE;

    if (variableName.length() == 0) {
        // the variable name is empty
        if (nameEntered) {
            // a name was entered before and is now empty
            newValidationStatus = IMessageProvider.ERROR;
            message = PreferencesMessages.PathEntryVariableDialog_variableNameEmptyMessage;
        }
    } else {
        if (namesInUse.contains(variableName) && !variableName.equals(originalName)) {
            // the variable name is already in use
            message = PreferencesMessages.PathEntryVariableDialog_variableAlreadyExistsMessage;
            newValidationStatus = IMessageProvider.ERROR;
        } else {
            allowFinish = true;
        }
    }

    // overwrite the current validation status / message only if everything is ok (clearing them)
    // or if we have a more serious problem than the current one
    if (validationStatus == IMessageProvider.NONE || newValidationStatus == IMessageProvider.ERROR) {
        validationStatus = newValidationStatus;
        validationMessage = message;
    }
    // only set the message here if it is not going to be set in 
    // validateVariableValue to avoid flashing.
    if (allowFinish == false)
        setMessage(validationMessage, validationStatus);
    return allowFinish;
}

From source file:org.eclipse.cdt.internal.ui.preferences.PathEntryVariableDialog.java

License:Open Source License

/**
 * Validates the current variable value, and updates this dialog's message.
 * /*from  ww w.  ja  va 2 s.com*/
 * @return true if the value is valid, false otherwise
 */
private boolean validateVariableValue() {
    boolean allowFinish = false;

    // if the current validationStatus is ERROR, no additional validation applies
    if (validationStatus == IMessageProvider.ERROR)
        return false;

    // assumes everything will be ok
    String message = standardMessage;
    int newValidationStatus = IMessageProvider.NONE;

    if (variableValue.length() == 0) {
        // the variable value is empty
        if (locationEntered) {
            // a location value was entered before and is now empty
            newValidationStatus = IMessageProvider.ERROR;
            message = PreferencesMessages.PathEntryVariableDialog_variableValueEmptyMessage;
        }
    } else if (!Path.EMPTY.isValidPath(variableValue)) {
        // the variable value is an invalid path
        message = PreferencesMessages.PathEntryVariableDialog_variableValueInvalidMessage;
        newValidationStatus = IMessageProvider.ERROR;
    } else if (!new Path(variableValue).isAbsolute()) {
        // the variable value is a relative path
        message = PreferencesMessages.PathEntryVariableDialog_pathIsRelativeMessage;
        newValidationStatus = IMessageProvider.ERROR;
    } else if (!new File(variableValue).exists()) {
        // the path does not exist (warning)
        message = PreferencesMessages.PathEntryVariableDialog_pathDoesNotExistMessage;
        newValidationStatus = IMessageProvider.WARNING;
        allowFinish = true;
    } else {
        allowFinish = true;
    }

    // overwrite the current validation status / message only if everything is ok (clearing them)
    // or if we have a more serious problem than the current one
    if (validationStatus == IMessageProvider.NONE || newValidationStatus > validationStatus) {
        validationStatus = newValidationStatus;
        validationMessage = message;
    }
    setMessage(validationMessage, validationStatus);
    return allowFinish;
}