当前位置: 首页>>代码示例>>Java>>正文


Java TextField.addTextChangeListener方法代码示例

本文整理汇总了Java中com.vaadin.ui.TextField.addTextChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.addTextChangeListener方法的具体用法?Java TextField.addTextChangeListener怎么用?Java TextField.addTextChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.TextField的用法示例。


在下文中一共展示了TextField.addTextChangeListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addStringFilters

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
/**
 * Ajoute un filtre en TextField sur une liste de colonnes
 * 
 * @param filterRow
 * @param container
 * @param propertys
 */
private void addStringFilters(String... propertys) {
	for (String property : propertys) {
		HeaderCell cell = getFilterCell(property);
		TextField filterField = new TextField();
		filterField.setImmediate(true);
		filterField.setWidth(100, Unit.PERCENTAGE);
		filterField.addStyleName(ValoTheme.TEXTFIELD_TINY);
		filterField.setInputPrompt(applicationContext.getMessage("filter.all", null, UI.getCurrent().getLocale()));
		filterField.addTextChangeListener(change -> {
			// Can't modify filters so need to replace
			container.removeContainerFilters(property);
			// (Re)create the filter if necessary
			if (!change.getText().isEmpty()) {
				container.addContainerFilter(new InsensitiveStringFilter(property, change.getText()));
			}
			fireFilterListener();
		});
		cell.setComponent(filterField);
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:28,代码来源:GridFormatting.java

示例2: addFileNameLayout

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private void addFileNameLayout(final Item newItem, final String baseSoftwareModuleNameVersion,
        final String customFileName, final String itemId) {
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    final TextField fileNameTextField = createTextField(
            baseSoftwareModuleNameVersion + "/" + customFileName + "/customFileName");
    fileNameTextField.setData(baseSoftwareModuleNameVersion + "/" + customFileName);
    fileNameTextField.setValue(customFileName);

    newItem.getItemProperty(FILE_NAME).setValue(fileNameTextField.getValue());

    final Label warningIconLabel = getWarningLabel();
    warningIconLabel.setId(baseSoftwareModuleNameVersion + "/" + customFileName + "/icon");
    setWarningIcon(warningIconLabel, fileNameTextField.getValue(), itemId);
    newItem.getItemProperty(WARNING_ICON).setValue(warningIconLabel);

    horizontalLayout.addComponent(fileNameTextField);
    horizontalLayout.setComponentAlignment(fileNameTextField, Alignment.MIDDLE_LEFT);
    horizontalLayout.addComponent(warningIconLabel);
    horizontalLayout.setComponentAlignment(warningIconLabel, Alignment.MIDDLE_RIGHT);
    newItem.getItemProperty(FILE_NAME_LAYOUT).setValue(horizontalLayout);

    fileNameTextField.addTextChangeListener(event -> onFileNameChange(event, warningIconLabel, newItem));
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:24,代码来源:UploadConfirmationWindow.java

示例3: createNameTextField

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private TextField createNameTextField() {
    final TextField nameField = new TextFieldBuilder().caption(i18n.getMessage("textfield.customfiltername"))
            .prompt(i18n.getMessage("textfield.customfiltername")).immediate(true)
            .id(UIComponentIdProvider.CUSTOM_FILTER_ADD_NAME).buildTextComponent();
    nameField.setPropertyDataSource(nameLabel);
    nameField.addTextChangeListener(this::onFilterNameChange);
    return nameField;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:9,代码来源:CreateOrUpdateFilterHeader.java

示例4: createKeyTextField

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private TextField createKeyTextField() {
    final TextField keyField = new TextFieldBuilder().caption(i18n.getMessage("textfield.key")).required(true)
            .prompt(i18n.getMessage("textfield.key")).immediate(true)
            .id(UIComponentIdProvider.METADATA_KEY_FIELD_ID).maxLengthAllowed(MetaData.KEY_MAX_SIZE)
            .buildTextComponent();
    keyField.addTextChangeListener(this::onKeyChange);
    keyField.setTextChangeEventMode(TextChangeEventMode.EAGER);
    keyField.setWidth("100%");
    return keyField;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:AbstractMetadataPopupLayout.java

示例5: createSearchField

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:TextFieldBuilder.java

示例6: setManufacturerFilter

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
/**
 * @param filterRow
 */
private void setManufacturerFilter(HeaderRow filterRow) {
	HeaderCell manufacturerFilter = filterRow.getCell(MANUFACTURER);
	TextField textField = new TextField();
	textField.setImmediate(true);
	// On Change of text, trigger filter operation
	textField.addTextChangeListener(getManufacturingFilterListener());
	manufacturerFilter.setComponent(textField);
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:12,代码来源:FilterGrid.java

示例7: buildFilter

import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private Component buildFilter() {
    final TextField filter = new TextField();
    filter.addTextChangeListener(new TextChangeListener() {
        @Override
        public void textChange(final TextChangeEvent event) {
            Filterable data = (Filterable) table.getContainerDataSource();
            data.removeAllContainerFilters();
            data.addContainerFilter(new Filter() {
                @Override
                public boolean passesFilter(final Object itemId,
                        final Item item) {

                    if (event.getText() == null
                            || event.getText().equals("")) {
                        return true;
                    }

                    return filterByProperty("country", item,
                            event.getText())
                            || filterByProperty("city", item,
                                    event.getText())
                            || filterByProperty("title", item,
                                    event.getText());

                }

                @Override
                public boolean appliesToProperty(final Object propertyId) {
                    if (propertyId.equals("country")
                            || propertyId.equals("city")
                            || propertyId.equals("title")) {
                        return true;
                    }
                    return false;
                }
            });
        }
    });

    filter.setInputPrompt("Filter");
    filter.setIcon(FontAwesome.SEARCH);
    filter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    filter.addShortcutListener(new ShortcutListener("Clear",
            KeyCode.ESCAPE, null) {
        @Override
        public void handleAction(final Object sender, final Object target) {
            filter.setValue("");
            ((Filterable) table.getContainerDataSource())
                    .removeAllContainerFilters();
        }
    });
    return filter;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:54,代码来源:TransactionsView.java


注:本文中的com.vaadin.ui.TextField.addTextChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。