本文整理了Java中com.google.gwt.event.logical.shared.ValueChangeEvent.shouldFire()
方法的一些代码示例,展示了ValueChangeEvent.shouldFire()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ValueChangeEvent.shouldFire()
方法的具体详情如下:
包路径:com.google.gwt.event.logical.shared.ValueChangeEvent
类名称:ValueChangeEvent
方法名:shouldFire
[英]Convenience method to allow subtypes to know when they should fire a value change event in a null-safe manner.
[中]方便的方法,允许子类型知道何时应该以空安全的方式触发值更改事件。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <T> the old value type
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <T> void fireIfNotEqual(HasValueChangeHandlers<T> source,
T oldValue, T newValue) {
if (shouldFire(source, oldValue, newValue)) {
ValueChangeEvent<T> event = new ValueChangeEvent<T>(newValue);
source.fireEvent(event);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <S> The event source
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <S extends HasValueChangeHandlers<Date> & HasHandlers> void fireIfNotEqualDates(
S source, Date oldValue, Date newValue) {
if (ValueChangeEvent.shouldFire(source, oldValue, newValue)) {
source.fireEvent(new DateChangeEvent(newValue));
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <S> The event source
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <S extends HasValueChangeHandlers<Date> & HasHandlers> void fireIfNotEqualDates(
S source, Date oldValue, Date newValue) {
if (ValueChangeEvent.shouldFire(source, oldValue, newValue)) {
source.fireEvent(new DateChangeEvent(newValue));
}
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <S> The event source
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <S extends HasValueChangeHandlers<Date> & HasHandlers> void fireIfNotEqualDates(
S source, Date oldValue, Date newValue) {
if (ValueChangeEvent.shouldFire(source, oldValue, newValue)) {
source.fireEvent(new DateChangeEvent(newValue));
}
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <T> the old value type
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <T> void fireIfNotEqual(HasValueChangeHandlers<T> source,
T oldValue, T newValue) {
if (shouldFire(source, oldValue, newValue)) {
ValueChangeEvent<T> event = new ValueChangeEvent<T>(newValue);
source.fireEvent(event);
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Fires value change event if the old value is not equal to the new value.
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
* @param <T> the old value type
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
public static <T> void fireIfNotEqual(HasValueChangeHandlers<T> source,
T oldValue, T newValue) {
if (shouldFire(source, oldValue, newValue)) {
ValueChangeEvent<T> event = new ValueChangeEvent<T>(newValue);
source.fireEvent(event);
}
}
内容来源于网络,如有侵权,请联系作者删除!