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

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

Introduction

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

Prototype

int ERROR

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

Click Source Link

Document

Constant for an error message (value 3).

Usage

From source file:org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage.java

License:Open Source License

/**
 * Sets this page's message based on the status severity.
 * //ww  w  . j a  v  a 2  s. c o m
 * @param status status with message and severity
 */
protected void setStatusMessage(IStatus status) {
    if (status.isOK()) {
        setMessage(status.getMessage());
    } else {
        switch (status.getSeverity()) {
        case IStatus.ERROR:
            setMessage(status.getMessage(), IMessageProvider.ERROR);
            break;
        case IStatus.INFO:
            setMessage(status.getMessage(), IMessageProvider.INFORMATION);
            break;
        case IStatus.WARNING:
            setMessage(status.getMessage(), IMessageProvider.WARNING);
            break;
        default:
            break;
        }
    }
}

From source file:org.eclipse.jpt.common.ui.internal.widgets.NewNameStateObject.java

License:Open Source License

/**
 * Validates the name property.//from  w w w. j av a2s .c om
 *
 * @param currentProblems The list to which <code>Problem</code>s can be
 * added
 */
private void addNameProblems(List<Problem> currentProblems) {

    if (StringTools.isBlank(name)) {
        currentProblems.add(buildProblem(JptCommonUiMessages.NEW_NAME_STATE_OBJECT__NAME_MUST_BE_SPECIFIED,
                IMessageProvider.ERROR));
    } else if (names.contains(name.trim())) {
        currentProblems.add(buildProblem(JptCommonUiMessages.NEW_NAME_STATE_OBJECT__NAME_ALREADY_EXISTS,
                IMessageProvider.ERROR));
    }
}

From source file:org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog.java

License:Open Source License

/**
 * Updates the error message, either shows the first error problem or hides
 * the error pane. If the progress bar is shown, then the error message will
 * not be shown./*w ww. ja  v  a  2 s  . co m*/
 */
private void updateMessage() {
    if (getSubject().branchProblemsSize() == 0) {
        clearMessage();
    } else {
        for (ListIterator<Node.Problem> problems = getSubject().branchProblems(); problems.hasNext();) {
            Node.Problem problem = problems.next();
            if (problem.messageType() == IMessageProvider.ERROR) {
                this.setErrorMessage(problem.messageKey(), problem.messageArguments());
            } else if (problem.messageType() == IMessageProvider.WARNING) {
                this.setWarningMessage(problem.messageKey(), problem.messageArguments());
            }
        }
    }
    if (!this.containsErrorMessage()) {
        clearErrorMessage();
    }
}

From source file:org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog.java

License:Open Source License

public final boolean containsErrorMessage() {
    boolean error = false;
    for (ListIterator<Node.Problem> problems = getSubject().branchProblems(); problems.hasNext();) {
        Node.Problem problem = problems.next();
        if (problem.messageType() == IMessageProvider.ERROR) {
            error = true;// ww  w. java2 s  . co m
        }
    }
    return error;
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConversionValueStateObject.java

License:Open Source License

private void addDataValueProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.dataValue)) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERSION_VALUE_STATE_OBJECT_DATA_VALUE_MUST_BE_SPECIFIED,
                IMessageProvider.ERROR));
    } else if (this.dataValues.contains(this.dataValue)) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERSION_VALUE_STATE_OBJECT_DATA_VALUE_ALREADY_EXISTS,
                IMessageProvider.ERROR));
    }/*from w  w  w. j  a va 2s .  co m*/
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConversionValueStateObject.java

License:Open Source License

private void addObjectValueProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.objectValue)) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERSION_VALUE_STATE_OBJECT_OBJECT_VALUE_MUST_BE_SPECIFIED,
                IMessageProvider.ERROR));
    }/*from  w ww  .jav  a 2  s . co  m*/
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConverterStateObject.java

License:Open Source License

private boolean addNumberOfConvertersProblemsTo(List<Problem> currentProblems) {
    if (this.converterContainer.getMaximumAllowedConverters() <= this.converterContainer.getConvertersSize()) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTERS_COMPOSITE_MAX_CONVERTERS_ERROR_MESSAGE,
                IMessageProvider.ERROR,
                Integer.valueOf(this.converterContainer.getMaximumAllowedConverters())));
        return false;
    }//from w ww. j a v a 2  s  . co  m
    return true;
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConverterStateObject.java

License:Open Source License

private void addNameProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.name)) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTER_STATE_OBJECT_NAME_MUST_BE_SPECIFIED,
                IMessageProvider.ERROR));
    } else if (names().contains(this.name)) {
        currentProblems.add(//from  w  ww .j a  v  a 2s  . c  om
                buildProblem(JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTER_STATE_OBJECT_NAME_EXISTS,
                        IMessageProvider.WARNING));
    } else if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTER_STATE_OBJECT_NAME_IS_RESERVED,
                IMessageProvider.ERROR));
    }
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConverterStateObject.java

License:Open Source License

private void addConverterTypeProblemsTo(List<Problem> currentProblems) {
    if (this.converterType == null) {
        currentProblems.add(buildProblem(
                JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTER_STATE_OBJECT_TYPE_MUST_BE_SPECIFIED,
                IMessageProvider.ERROR));
    }/*from ww  w  . ja v a2 s .  co m*/
}

From source file:org.eclipse.jpt.jpa.ui.internal.details.AddQueryStateObject.java

License:Open Source License

private void addNameProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.name)) {
        currentProblems.add(buildProblem(JptJpaUiDetailsMessages.QueryStateObject_nameMustBeSpecified,
                IMessageProvider.ERROR));
    } else if (names().contains(this.name)) {
        currentProblems/* www .ja va2 s .co m*/
                .add(buildProblem(JptJpaUiDetailsMessages.AddQueryDialog_nameExists, IMessageProvider.WARNING));
    }
}