com.vaadin.data.util.converter.StringToIntegerConverter Java Examples

The following examples show how to use com.vaadin.data.util.converter.StringToIntegerConverter. 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: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createIntegerTextField(final String in18Key, final String id) {
    final TextField textField = createTextField(in18Key, id, 32);
    textField.setConverter(new StringToIntegerConverter());
    textField.setConversionError(i18n.getMessage(MESSAGE_ENTER_NUMBER));
    textField.setSizeUndefined();
    return textField;
}
 
Example #2
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createPercentageField(final String in18Key, final String id) {
    final TextField textField = new TextFieldBuilder(32).prompt(i18n.getMessage(in18Key)).id(id)
            .buildTextComponent();
    textField.setWidth(80, Unit.PIXELS);
    textField.setConverter(new StringToIntegerConverter());
    textField.addValidator(this::validateMandatoryPercentage);
    return textField;
}