Java Code Examples for com.vaadin.ui.TextField#addTextChangeListener()

The following examples show how to use com.vaadin.ui.TextField#addTextChangeListener() . 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: CreateOrUpdateFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createNameTextField() {
    final TextField nameField = new TextFieldBuilder(NamedEntity.NAME_MAX_SIZE)
            .caption(i18n.getMessage("textfield.customfiltername")).required(true, i18n)
            .id(UIComponentIdProvider.CUSTOM_FILTER_ADD_NAME).buildTextComponent();
    nameField.setPropertyDataSource(nameLabel);
    nameField.addTextChangeListener(this::onFilterNameChange);
    return nameField;
}
 
Example 2
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createKeyTextField() {
    final TextField keyField = new TextFieldBuilder(MetaData.KEY_MAX_SIZE).caption(i18n.getMessage("textfield.key"))
            .required(true, i18n).id(UIComponentIdProvider.METADATA_KEY_FIELD_ID).buildTextComponent();
    keyField.addTextChangeListener(this::onKeyChange);
    keyField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    keyField.setTextChangeTimeout(INPUT_DEBOUNCE_TIMEOUT);
    keyField.setWidth("100%");
    return keyField;
}
 
Example 3
Source File: TextFieldBuilder.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a search text field.
 * 
 * @param textChangeListener
 *            listener when text is changed.
 * @return the textfield
 */
public TextField createSearchField(final TextChangeListener textChangeListener) {
    final TextField textField = style("filter-box").styleName("text-style filter-box-hide").buildTextComponent();
    textField.setWidth(100.0F, Unit.PERCENTAGE);
    textField.addTextChangeListener(textChangeListener);
    textField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    // 1 seconds timeout.
    textField.setTextChangeTimeout(1000);
    return textField;
}
 
Example 4
Source File: BasicModel.java    From chipster with MIT License 5 votes vote down vote up
private void initElements() {
	
	lbName = new Label("Display name:");
	lbId = new Label();
	lbDescription = new Label("Description:");
	lbOptional = new Label("Optional:");
	
	name = new TextField();
	name.setWidth(WIDTH);
	name.setDescription("Display name for the element");
	name.setImmediate(true);
	name.addTextChangeListener(new CSCTextChangeListener(this));
	
	id = new TextField();
	id.setDescription("file name or unique identification");
	id.setImmediate(true);
	id.setRequired(true);
	id.setRequiredError(REQUIRED_TEXT);
	id.setWidth(WIDTH);
	id.addTextChangeListener(new CSCTextChangeListener(this, true));
	
	description = new TextArea();
	description.setWidth(WIDTH);
	description.setDescription("Short description");
	
	layout = new HorizontalLayout();
	
	prefix = new TextField();
	postfix = new TextField();
	
	layout.addComponent(prefix);
	layout.addComponent(new Label(MULTI_FILE_TEXT));
	layout.addComponent(postfix);
	
	optional = new CheckBox();
	optional.setDescription("Is this element optional");
	optional.setImmediate(true);
}