Java 类com.vaadin.server.CompositeErrorMessage 实例源码

项目:viritin    文件:MTextField.java   
@Override
public ErrorMessage getErrorMessage() {

    Validator.InvalidValueException validationError = getValidationError();

    final ErrorMessage superError = getComponentError();

    if (superError == null && validationError == null
            && getCurrentBufferedSourceException() == null) {
        return null;
    }
    // Throw combination of the error types
    return new CompositeErrorMessage(
            new ErrorMessage[]{
                superError,
                AbstractErrorMessage
                .getErrorMessageForException(validationError),
                AbstractErrorMessage
                .getErrorMessageForException(
                        getCurrentBufferedSourceException())});
}
项目:viritin    文件:MPasswordField.java   
@Override
public ErrorMessage getErrorMessage() {

    Validator.InvalidValueException validationError = getValidationError();

    final ErrorMessage superError = getComponentError();

    if (superError == null && validationError == null
            && getCurrentBufferedSourceException() == null) {
        return null;
    }
    // Throw combination of the error types
    return new CompositeErrorMessage(
            new ErrorMessage[]{
                superError,
                AbstractErrorMessage
                .getErrorMessageForException(validationError),
                AbstractErrorMessage
                .getErrorMessageForException(
                        getCurrentBufferedSourceException())});
}
项目:cuba    文件:CubaPasswordField.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {

        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }

    return superError;
}
项目:cuba    文件:CubaListSelect.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }
    return superError;
}
项目:cuba    文件:CubaSourceCodeEditor.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }

    return superError;
}
项目:cuba    文件:CubaDateFieldWrapper.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }
    return superError;
}
项目:cuba    文件:CubaResizableTextAreaWrapper.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!textArea.isReadOnly() && isRequired() && textArea.isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }

    return superError;
}
项目:cuba    文件:CubaTextArea.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }
    return superError;
}
项目:cuba    文件:CubaFileUploadWrapper.java   
@Override
public ErrorMessage getErrorMessage() {
    ErrorMessage superError = super.getErrorMessage();
    if (!isReadOnly() && isRequired() && isEmpty()) {
        ErrorMessage error = AbstractErrorMessage.getErrorMessageForException(
                new com.vaadin.data.Validator.EmptyValueException(getRequiredError()));
        if (error != null) {
            return new CompositeErrorMessage(superError, error);
        }
    }
    return superError;
}
项目:minimal-j    文件:VaadinIndication.java   
public static void setValidationMessages(List<String> validationMessages, AbstractComponent component) {
    if (validationMessages.isEmpty()) {
        component.setComponentError(null);
    } else if (validationMessages.size() == 1) {
        component.setComponentError(new UserError(validationMessages.get(0)));
    } else {
        ErrorMessage[] errorMessages = new ErrorMessage[validationMessages.size()];
        for (int i = 0; i<validationMessages.size(); i++) {
            errorMessages[i] = new UserError(validationMessages.get(i));
        }
        CompositeErrorMessage compositeErrorMessage = new CompositeErrorMessage(errorMessages);
        component.setComponentError(compositeErrorMessage);
    }
}
项目:hypothesis    文件:SelectPanel.java   
@Override
public ErrorMessage getErrorMessage() {

    /*
     * Check validation errors only if automatic validation is enabled.
     * Empty, required fields will generate a validation error containing
     * the requiredError string. For these fields the exclamation mark will
     * be hidden but the error must still be sent to the client.
     */
    InvalidValueException validationError = null;
    if (isValidationVisible()) {
        try {
            validate();
        } catch (InvalidValueException e) {
            if (!e.isInvisible()) {
                validationError = e;
            }
        }
    }

    // Check if there are any systems errors
    final ErrorMessage superError = super.getErrorMessage();

    // Return if there are no errors at all
    if (superError == null && validationError == null) {
        return null;
    }

    // Throw combination of the error types
    return new CompositeErrorMessage(
            new ErrorMessage[] { superError, AbstractErrorMessage.getErrorMessageForException(validationError) });
}