本文整理了Java中com.vaadin.flow.dom.Element.addPropertyChangeListener()
方法的一些代码示例,展示了Element.addPropertyChangeListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.addPropertyChangeListener()
方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称:Element
方法名:addPropertyChangeListener
[英]Adds a property change listener.
Use either two way Polymer binding or synchronize property explicitly to be able to get property change events from the client.
[中]添加属性更改侦听器。
显式使用双向聚合绑定或同步属性,以便能够从客户端获取属性更改事件。
代码示例来源:origin: com.vaadin/vaadin-checkbox-flow
private void registerValidation() {
if (validationRegistration != null) {
validationRegistration.remove();
}
validationRegistration = getElement().addPropertyChangeListener(VALUE,
validationListener);
}
代码示例来源:origin: com.vaadin/vaadin-radio-button-flow
private void registerValidation() {
if (validationRegistration != null) {
validationRegistration.remove();
}
validationRegistration = getElement().addPropertyChangeListener("value",
validationListener);
}
}
代码示例来源:origin: com.vaadin/vaadin-select-flow
private void registerValidation() {
if (validationRegistration != null) {
validationRegistration.remove();
}
validationRegistration = getElement().addPropertyChangeListener("value",
validationListener);
}
代码示例来源:origin: com.vaadin/vaadin-tabs-flow
/**
* Constructs an empty new object with {@link Orientation#HORIZONTAL
* HORIZONTAL} orientation.
*/
public Tabs() {
setSelectedIndex(-1);
getElement().addPropertyChangeListener(SELECTED,
event -> updateSelectedTab(event.isUserOriginated()));
}
代码示例来源:origin: com.vaadin/vaadin-checkbox-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-checkbox-flow
/**
* Adds a listener for {@code indeterminate-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addIndeterminateChangeListener(
ComponentEventListener<IndeterminateChangeEvent<R>> listener) {
return getElement().addPropertyChangeListener("indeterminate",
event -> listener.onComponentEvent(
new IndeterminateChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-radio-button-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-upload-flow
/**
* Adds a listener for {@code max-files-reached-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addMaxFilesReachedChangeListener(
ComponentEventListener<MaxFilesReachedChangeEvent<R>> listener) {
return getElement().addPropertyChangeListener("maxFilesReached",
event -> listener.onComponentEvent(
new MaxFilesReachedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-text-field-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-date-picker-flow
/**
* Adds a listener for {@code opened-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addOpenedChangeListener(
ComponentEventListener<OpenedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("opened",
event -> listener.onComponentEvent(
new OpenedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-checkbox-flow
/**
* Adds a listener for {@code checked-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addCheckedChangeListener(
ComponentEventListener<CheckedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("checked",
event -> listener.onComponentEvent(
new CheckedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-text-field-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-date-picker-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-time-picker-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-notification-flow
/**
* Adds a listener for {@code opened-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addOpenedChangeListener(
ComponentEventListener<OpenedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("opened",
event -> listener.onComponentEvent(
new OpenedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
}
代码示例来源:origin: com.vaadin/vaadin-context-menu-flow
/**
* Adds a listener for {@code opened-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addOpenedChangeListener(
ComponentEventListener<OpenedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("opened",
event -> listener.onComponentEvent(
new OpenedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
}
代码示例来源:origin: com.vaadin/vaadin-radio-button-flow
/**
* Adds a listener for {@code checked-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addCheckedChangeListener(
ComponentEventListener<CheckedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("checked",
event -> listener.onComponentEvent(
new CheckedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
}
代码示例来源:origin: com.vaadin/vaadin-upload-flow
/**
* Adds a listener for {@code files-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addFilesChangeListener(
ComponentEventListener<FilesChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("files",
event -> listener.onComponentEvent(
new FilesChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-select-flow
/**
* Adds a listener for {@code opened-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addOpenedChangeListener(
ComponentEventListener<OpenedChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("opened",
event -> listener.onComponentEvent(
new OpenedChangeEvent<R>((R) this,
event.isUserOriginated())));
}
代码示例来源:origin: com.vaadin/vaadin-select-flow
/**
* Adds a listener for {@code invalid-changed} events fired by the
* webcomponent.
*
* @param listener
* the listener
* @return a {@link Registration} for removing the event listener
*/
protected Registration addInvalidChangeListener(
ComponentEventListener<InvalidChangeEvent<R>> listener) {
return getElement()
.addPropertyChangeListener("invalid",
event -> listener.onComponentEvent(
new InvalidChangeEvent<R>((R) this,
event.isUserOriginated())));
}
内容来源于网络,如有侵权,请联系作者删除!