/** * 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)); } }
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) { if (date != null) { picker.setCurrentMonth(date); } picker.setValue(date, false); if (updateText) { format.reset(this, false); box.setText(getFormat().format(this, date)); } if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldDate, date); } }
/** * Sets the {@link DatePicker}'s value. * * @param newValue the new value for this date picker * @param fireEvents should events be fired. */ public final void setValue(Date newValue, boolean fireEvents) { Date oldValue = value; if (oldValue != null) { removeStyleFromDates(css().dayIsValue(), oldValue); } value = CalendarUtil.copyDate(newValue); if (value != null) { addStyleToDates(css().dayIsValue(), value); } getView().setAriaSelectedCell(newValue); if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue); } }
/** * 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)); } }
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) { if (date != null) { picker.setCurrentMonth(date); } picker.setValue(date, false); if (updateText) { format.reset(this, false); box.setText(getFormat().format(this, date)); } if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldDate, date); } }
/** * 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)); } }
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) { if (date != null) { picker.setCurrentMonth(date); } picker.setValue(date, false); if (updateText) { format.reset(this, false); box.setText(getFormat().format(this, date)); } if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldDate, date); } }
/** * Sets the {@link DatePicker}'s value. * * @param newValue the new value for this date picker * @param fireEvents should events be fired. */ public final void setValue(Date newValue, boolean fireEvents) { Date oldValue = value; if (oldValue != null) { removeStyleFromDates(css().dayIsValue(), oldValue); } value = CalendarUtil.copyDate(newValue); if (value != null) { addStyleToDates(css().dayIsValue(), value); } getView().setAriaSelectedCell(newValue); if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue); } }
/** * Sets the {@link DatePicker}'s value. * * @param newValue the new value for this date picker * @param fireEvents should events be fired. */ public final void setValue(Date newValue, boolean fireEvents) { Date oldValue = value; if (oldValue != null) { removeStyleFromDates(css().dayIsValue(), oldValue); } value = CalendarUtil.copyDate(newValue); if (value != null) { addStyleToDates(css().dayIsValue(), value); } getView().setAriaSelectedCell(newValue); if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue); } }