Example usage for com.google.gwt.event.logical.shared ValueChangeEvent fire

List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent fire

Introduction

In this page you can find the example usage for com.google.gwt.event.logical.shared ValueChangeEvent fire.

Prototype

public static <T> void fire(HasValueChangeHandlers<T> source, T value) 

Source Link

Document

Fires a value change event on all registered handlers in the handler manager.

Usage

From source file:org.gwtbootstrap3.client.ui.impl.CheckBoxImpl.java

License:Apache License

public void ensureDomEventHandlers(final CheckBox checkBox) {
    checkBox.addChangeHandler(new ChangeHandler() {

        @Override// w w  w. j  a va 2 s  .c  om
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(checkBox, checkBox.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.client.ui.impl.CheckBoxImplIE8.java

License:Apache License

@Override
public void ensureDomEventHandlers(final CheckBox checkBox) {
    checkBox.addClickHandler(new ClickHandler() {

        @Override//from  w ww . j  a  v  a2  s  .com
        public void onClick(ClickEvent event) {
            ValueChangeEvent.fire(checkBox, checkBox.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.client.ui.impl.RadioImpl.java

License:Apache License

public void ensureDomEventHandlers(final Radio radio) {
    radio.addChangeHandler(new ChangeHandler() {

        @Override/*from ww w. ja  v a 2  s. co m*/
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(radio, radio.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.client.ui.impl.SimpleCheckBoxImpl.java

License:Apache License

public void ensureDomEventHandlers(final SimpleCheckBox simpleCheckBox) {
    simpleCheckBox.addChangeHandler(new ChangeHandler() {

        @Override/*from   w  ww.  j  a  va  2 s  .co m*/
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(simpleCheckBox, simpleCheckBox.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.client.ui.impl.SimpleCheckBoxImplIE8.java

License:Apache License

@Override
public void ensureDomEventHandlers(final SimpleCheckBox simpleCheckBox) {
    simpleCheckBox.addClickHandler(new ClickHandler() {

        @Override//from   w  w w . j a v  a  2 s. c o m
        public void onClick(ClickEvent event) {
            ValueChangeEvent.fire(simpleCheckBox, simpleCheckBox.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.client.ui.impl.SimpleRadioButtonImpl.java

License:Apache License

public void ensureDomEventHandlers(final SimpleRadioButton simpleRadioButton) {
    simpleRadioButton.addChangeHandler(new ChangeHandler() {

        @Override/*from w  w w .j a  va2  s . c  o m*/
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(simpleRadioButton, simpleRadioButton.getValue());
        }

    });
}

From source file:org.gwtbootstrap3.extras.datepicker.client.ui.base.DatePickerBase.java

License:Apache License

/** {@inheritDoc} */
@Override//from  w  w  w. ja va 2 s  .  c o m
public void onChangeDate(final Event e) {
    fireEvent(new ChangeDateEvent(e));
    ValueChangeEvent.fire(DatePickerBase.this, getValue());
    hide();
}

From source file:org.gwtbootstrap3.extras.datepicker.client.ui.base.DatePickerBase.java

License:Apache License

/** {@inheritDoc} */
@Override/*from  w  ww .j av  a 2s  .c o  m*/
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<Date> dateValueChangeHandler) {
    textBox.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            ValueChangeEvent.fire(DatePickerBase.this, getValue());
        }
    });
    return addHandler(dateValueChangeHandler, ValueChangeEvent.getType());
}

From source file:org.gwtbootstrap3.extras.datepicker.client.ui.base.DatePickerBase.java

License:Apache License

/** {@inheritDoc} */
@Override/*from www  .j  a  v  a  2  s  .  c o  m*/
public void setValue(final Date value, final boolean fireEvents) {
    errorHandlerMixin.clearErrors();
    textBox.setValue(value != null ? dateTimeFormat.format(value) : null);
    update(textBox.getElement());

    if (fireEvents) {
        ValueChangeEvent.fire(DatePickerBase.this, value);
    }
}

From source file:org.gwtbootstrap3.extras.datetimepicker.client.ui.base.DateTimeBoxBase.java

License:Apache License

@Override
public void setValue(final Date value, final boolean fireEvents) {
    // We schedule a fixed delay to that we can make sure the element is properly loaded
    // so that we can set the value on it
    Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
        @Override/*ww w  .  java2s. c  o  m*/
        public boolean execute() {
            if (DateTimeBoxBase.this.isAttached()) {
                updateValue(textBox.getElement(), value);

                if (fireEvents) {
                    ValueChangeEvent.fire(DateTimeBoxBase.this, value);
                }
                return false;
            } else {
                return true;
            }
        }
    }, 1000);
}