Java 类com.vaadin.ui.HasValueChangeMode 实例源码

项目:holon-vaadin    文件:InputFieldWrapper.java   
@Override
public void setValueChangeMode(ValueChangeMode valueChangeMode) {
    ObjectUtils.argumentNotNull(valueChangeMode, "ValueChangeMode must be not null");
    if (isValueChangeModeSupported()) {
        ((HasValueChangeMode) field).setValueChangeMode(valueChangeMode);
    }
}
项目:holon-vaadin    文件:InputFieldWrapper.java   
@Override
public ValueChangeMode getValueChangeMode() {
    if (isValueChangeModeSupported()) {
        return ((HasValueChangeMode) field).getValueChangeMode();
    }
    return ValueChangeMode.BLUR;
}
项目:holon-vaadin    文件:InputFieldWrapper.java   
@Override
public void setValueChangeTimeout(int valueChangeTimeout) {
    if (valueChangeTimeout < 0) {
        throw new IllegalArgumentException("Value change timeout must be greater or equal to 0");
    }
    if (isValueChangeModeSupported()) {
        ((HasValueChangeMode) field).setValueChangeTimeout(valueChangeTimeout);
    }
}
项目:holon-vaadin    文件:InputFieldWrapper.java   
@Override
public int getValueChangeTimeout() {
    if (isValueChangeModeSupported()) {
        return ((HasValueChangeMode) field).getValueChangeTimeout();
    }
    return -1;
}
项目:holon-vaadin    文件:InputFieldWrapper.java   
@Override
public boolean isValueChangeModeSupported() {
    return field instanceof HasValueChangeMode;
}
项目:viritin    文件:FluentHasValueChangeMode.java   
/**
 * Sets the mode how the TextField triggers {@link ValueChangeEvent}s.
 *
 * @param valueChangeMode
 *            the new mode
 *
 * @see ValueChangeMode
 * @return this (for method chaining)
 */
public default S withValueChangeMode(ValueChangeMode valueChangeMode) {
    ((HasValueChangeMode) this).setValueChangeMode(valueChangeMode);
    return (S) this;
}
项目:viritin    文件:FluentHasValueChangeMode.java   
/**
 * Sets how often {@link ValueChangeEvent}s are triggered when the
 * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
 * {@link ValueChangeMode#TIMEOUT}.
 *
 * @param valueChangeTimeout
 *            timeout in milliseconds, must be greater or equal to 0
 * @throws IllegalArgumentException
 *             if given timeout is smaller than 0
 *
 * @see ValueChangeMode
 * @return this (for method chaining)
 */
public default S withValueChangeTimeout(int valueChangeTimeout) {
    ((HasValueChangeMode) this).setValueChangeTimeout(valueChangeTimeout);
    return (S) this;
}