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

The following examples show how to use com.vaadin.data.util.converter.StringToIntegerConverter. These examples are extracted from open source projects. 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
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 Project: hawkbit   Source File: DefineGroupsLayout.java    License: 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;
}