com.vaadin.data.validator.IntegerRangeValidator Java Examples

The following examples show how to use com.vaadin.data.validator.IntegerRangeValidator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ColumnSelectionWindow.java    From XACML with MIT License 6 votes vote down vote up
protected void initializeText() {
	//
	// Add a validator
	//
	this.textFieldColumn.addValidator(new IntegerRangeValidator("Please enter an integer greater than or equal to 0.", 0, null));
	//
	// Respond to text changing to setup the button
	//
	this.textFieldColumn.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void textChange(TextChangeEvent event) {
			if (event.getText() != null && event.getText().isEmpty() == false) {
				self.buttonSave.setEnabled(true);
			} else {
				self.buttonSave.setEnabled(false);
			}
		}
	});
}
 
Example #2
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void validate(final Object value) {
    if (isNoOfGroupsOrTargetFilterEmpty()) {
        uiNotification
                .displayValidationError(i18n.getMessage("message.rollout.noofgroups.or.targetfilter.missing"));
    } else {
        if (value != null) {
            final int groupSize = getGroupSize();
            new IntegerRangeValidator(i18n.getMessage(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, groupSize), 0,
                    groupSize).validate(Integer.valueOf(value.toString()));
        }
    }
}
 
Example #3
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void validate(final Object value) {
    if (value != null) {
        new IntegerRangeValidator(i18n.getMessage(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100)
                .validate(Integer.valueOf(value.toString()));
    }
}
 
Example #4
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void validate(final Object value) {
    if (value != null) {
        final int maxGroups = quotaManagement.getMaxRolloutGroupsPerRollout();
        new IntegerRangeValidator(i18n.getMessage(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 1, maxGroups), 1,
                maxGroups).validate(Integer.valueOf(value.toString()));
    }
}
 
Example #5
Source File: ActionAutocleanupConfigurationItem.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
ActionExpiryValidator(final String message) {
    this.message = message;
    this.rangeValidator = new IntegerRangeValidator(message, 1, MAX_EXPIRY_IN_DAYS);
}
 
Example #6
Source File: CustomIntegerRangeValidator.java    From gazpachoquest with GNU General Public License v3.0 4 votes vote down vote up
public CustomIntegerRangeValidator(String errorMessage, Integer minValue, Integer maxValue) {
    super(errorMessage);
    this.integerRangeValidator = new IntegerRangeValidator(errorMessage, minValue, maxValue);
}