本文整理汇总了Java中com.vaadin.event.FieldEvents.TextChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java TextChangeListener类的具体用法?Java TextChangeListener怎么用?Java TextChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextChangeListener类属于com.vaadin.event.FieldEvents包,在下文中一共展示了TextChangeListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getManufacturingFilterListener
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
/**
* Returns the TextChangeListener that gets triggered
*
* @return
*/
private TextChangeListener getManufacturingFilterListener() {
return new TextChangeListener() {
/**
*
*/
private static final long serialVersionUID = -2368474286053602744L;
@Override
public void textChange(TextChangeEvent event) {
String newValue = (String) event.getText();
@SuppressWarnings("unchecked")
BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
.getContainerDataSource());
// This is important, this removes the previous filter that was
// used to filter the container
container.removeContainerFilters(MANUFACTURER);
if (null != newValue && !newValue.isEmpty()) {
container.addContainerFilter(new SimpleStringFilter(
MANUFACTURER, newValue, true, false));
}
grid.recalculateColumnWidths();
}
};
}
示例2: initializeText
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void initializeText() {
this.textAreaComments.setImmediate(true);
this.textAreaComments.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void textChange(TextChangeEvent event) {
if (event.getText().isEmpty()) {
self.buttonPush.setEnabled(false);
} else {
if (self.container.getConflictCount() == 0) {
self.buttonPush.setEnabled(true);
} else {
self.buttonPush.setEnabled(false);
}
}
}
});
}
示例3: initializeText
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
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);
}
}
});
}
示例4: initSearchField
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void initSearchField() {
HorizontalLayout searchLayout = new HorizontalLayout();
searchLayout.setSpacing(true);
addComponent(searchLayout);
// textfield
searchField = new TextField();
searchField.setInputPrompt(i18nManager.getMessage(Messages.PEOPLE_SEARCH));
searchField.setWidth(180, UNITS_PIXELS);
searchField.focus();
searchLayout.addComponent(searchField);
// Logic to change table according to input
searchField.addListener(new TextChangeListener() {
public void textChange(TextChangeEvent event) {
searchPeople(event.getText());
}
});
initSelectMyselfButton(searchLayout);
}
示例5: buildUI
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void buildUI() {
ButtonBar buttonBar = new ButtonBar();
addComponent(buttonBar);
editor = CommonUiUtils.createAceEditor();
editor.setTextChangeEventMode(TextChangeEventMode.LAZY);
editor.setTextChangeTimeout(200);
editor.setMode(AceMode.text);
editor.setValue(component.get(TextConstant.SETTING_TEXT));
editor.addTextChangeListener(new TextChangeListener() {
public void textChange(TextChangeEvent event) {
Setting data = component.findSetting(TextConstant.SETTING_TEXT);
data.setValue(event.getText());
context.getConfigurationService().save(data);
}
});
addComponent(editor);
setExpandRatio(editor, 1);
}
示例6: buildUI
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void buildUI() {
ButtonBar buttonBar = new ButtonBar();
addComponent(buttonBar);
editor = CommonUiUtils.createAceEditor();
editor.setTextChangeEventMode(TextChangeEventMode.LAZY);
editor.setTextChangeTimeout(200);
editor.setMode(AceMode.xml);
editor.setValue(component.get(Web.BODY_TEXT));
editor.addTextChangeListener(new TextChangeListener() {
public void textChange(TextChangeEvent event) {
component.put(Web.BODY_TEXT, event.getText());
context.getConfigurationService().save(component.findSetting(Web.BODY_TEXT));
}
});
addComponent(editor);
setExpandRatio(editor, 1);
}
示例7: AutoCompleteTextField
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
public AutoCompleteTextField()
{
setTextChangeEventMode(TextChangeEventMode.LAZY);
setImmediate(true);
addTextChangeListener(new TextChangeListener()
{
private static final long serialVersionUID = 1L;
@Override
public void textChange(final TextChangeEvent event)
{
options.clear();
if (listener != null)
{
listener.handleQuery(AutoCompleteTextField.this, event.getText());
}
if (!options.isEmpty())
{
createContextMenu();
showOptionMenu();
}
}
});
}
示例8: initializeTextField
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void initializeTextField() {
//
// Initialize GUI settings
//
this.textFieldFilter.setImmediate(true);
//
// Respond to the text change events
//
this.textFieldFilter.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
SimpleStringFilter currentFilter = null;
@Override
public void textChange(TextChangeEvent event) {
//
// Remove current filter
//
if (this.currentFilter != null) {
FunctionSelectionWindow.highOrderFunctions.removeContainerFilter(this.currentFilter);
this.currentFilter = null;
}
//
// Get the text
//
String value = event.getText();
if (value != null && value.length() > 0) {
//
// Add the new filter
//
this.currentFilter = new SimpleStringFilter(PROPERTY_SHORTNAME, value, true, false);
FunctionSelectionWindow.highOrderFunctions.addContainerFilter(this.currentFilter);
}
}
});
}
示例9: initializeTextField
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
protected void initializeTextField() {
this.textFieldSubdomain.setRequired(true);
this.textFieldSubdomain.setRequiredError("Please enter a valid sub domain");
//
// Validate the name entered
//
this.textFieldSubdomain.addValidator(new RegexpValidator(SUBDOMAIN_NAME_PATTERN, true, ERROR_MESSAGE) {
private static final long serialVersionUID = 1L;
});
//
// Respond to events
//
this.textFieldSubdomain.setImmediate(true);
this.textFieldSubdomain.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void textChange(TextChangeEvent event) {
if (event.getText() != null && event.getText().length() > 0) {
self.buttonSave.setEnabled(true);
} else {
self.buttonSave.setEnabled(false);
}
}
});
}
示例10: createSearchField
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的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;
}
示例11: init
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
/**
* Inits the.
*/
private void init() {
VerticalLayout la = new VerticalLayout();
final TextField tf = new TextField("Project name: (lower-case letters and numbers)");
tf.setImmediate(true);
skBox.setValue(true);
la.addComponent(tf);
tf.addTextChangeListener(new TextChangeListener() {
public void textChange(TextChangeEvent event) {
cnpButton.setEnabled(ProjectFileUtils.isValidProjectName(event.getText()));
}});
projectTypeGroup.select("Vaadin");
/* if (MideaasConfig.easiCloudsFeaturesTurnedOn()){
la.addComponent(projectTypeGroup);
la.addComponent(skBox);
}*/
initNewProjectButton(tf, skBox);
cnpButton.setWidth("100%");
// setIcon(ICON);
la.addComponent(cnpButton);
this.setContent(la);
}
示例12: initializeUnselectedColumn
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
private Layout initializeUnselectedColumn() {
VerticalLayout unselectedColumn = new VerticalLayout();
unselectedColumn.setSizeFull();
filterUnselected.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void textChange(TextChangeEvent event) {
unselectedContainer.removeAllContainerFilters();
unselectedContainer.addContainerFilter("caption",
event.getText(), true, false);
}
});
filterUnselected.setWidth("100%");
unselected.setContainerDataSource(unselectedContainer);
unselected.setMultiSelect(true);
unselected.setSizeFull();
unselected.setItemCaptionPropertyId("caption");
unselectedContainer.sort(new String[] { "caption" },
new boolean[] { true });
unselectedColumn.addComponent(filterUnselected);
unselectedColumn.addComponent(unselected);
unselectedColumn.setExpandRatio(unselected, 1);
return unselectedColumn;
}
示例13: initializeSelectedColumn
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
private Layout initializeSelectedColumn() {
VerticalLayout selectedColumn = new VerticalLayout();
selectedColumn.setSizeFull();
filterSelected.setWidth("100%");
filterSelected.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void textChange(TextChangeEvent event) {
selectedContainer.removeAllContainerFilters();
selectedContainer.addContainerFilter("caption",
event.getText(), true, false);
}
});
selected.setContainerDataSource(selectedContainer);
selected.setMultiSelect(true);
selected.setSizeFull();
selected.setItemCaptionPropertyId("caption");
selectedContainer.sort(new String[] { "caption" },
new boolean[] { true });
selectedColumn.addComponent(filterSelected);
selectedColumn.addComponent(selected);
selectedColumn.setExpandRatio(selected, 1);
return selectedColumn;
}
示例14: withTextChangeListener
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
@Override
public NumberInputBuilder<T> withTextChangeListener(TextChangeListener listener) {
getInstance().addTextChangeListener(listener);
return builder();
}
示例15: withTextChangeListener
import com.vaadin.event.FieldEvents.TextChangeListener; //导入依赖的package包/类
@Override
public StringInputBuilder withTextChangeListener(TextChangeListener listener) {
getInstance().addTextChangeListener(listener);
return builder();
}