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.openelis.gwt.widget.Dropdown.java

License:Open Source License

@Override
public void complete() {
    super.complete();
    field.setValue(getValue());//from  w w w. j  ava2s . com
    ValueChangeEvent.fire(this, getValue());
    field.clearExceptions(this);
    checkValue();
    textbox.setFocus(true);
    activeWidget = null;
}

From source file:org.openelis.ui.widget.AutoComplete.java

License:Open Source License

/**
 * Overridden method to set the T value of this widget. Will fire a value
 * change event if fireEvents is true and the value is changed from its
 * current value//from w w  w. java2s  .  c om
 */
@Override
public void setValue(AutoCompleteValue value, boolean fireEvents) {

    if (!Util.isDifferent(this.value == null ? null : this.value, value))
        return;

    table.setModel(null);

    if (value != null) {
        textbox.setText(value.getDisplay());
    } else {
        table.selectRowAt(-1);
        textbox.setText("");
    }

    this.value = value;

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

From source file:org.openelis.ui.widget.calendar.Calendar.java

License:Open Source License

/**
 * Sets the current value of this widget and will fire a ValueChangeEvent if
 * the value is different than what is currently stored.
 *//* w w  w  .  ja va  2  s  . co m*/
public void setValue(Datetime value, boolean fireEvents) {
    boolean diff;

    diff = Util.isDifferent(this.value, value);
    this.value = value;
    textbox.setText(helper.format(value));

    clearValidateExceptions();
    if (fireEvents && diff)
        ValueChangeEvent.fire(this, value);
}

From source file:org.openelis.ui.widget.celltable.Table.java

License:Open Source License

/**
 * Sets the model and will fire ValueChangeEvent if fireEvents is true as
 * part of the HasValue interface/*w ww.  j  a va 2 s. co  m*/
 */
public void setValue(List<T> value, boolean fireEvents) {
    setModel(value);

    if (fireEvents)
        ValueChangeEvent.fire(this, value);

}

From source file:org.openelis.ui.widget.CheckBox.java

License:Open Source License

/**
 * Sets the value of this widget. Will fire a ValueChangeEvent if fireEvents
 * passed as true and the new value is not equals to old value
 *///  w  w w. j  a v a  2s  .c  om
public void setValue(String value, boolean fireEvents) {

    if (value == null) {
        if (check.getMode() == Check.Mode.TWO_STATE)
            check.uncheck();
        else
            check.unkown();
    } else if ("Y".equals(value))
        check.check();
    else
        check.uncheck();

    if (!Util.isDifferent(value, this.value))
        return;

    this.value = value;

    if (fireEvents && !queryMode)
        ValueChangeEvent.fire(this, value);
}

From source file:org.openelis.ui.widget.CheckBox.java

License:Open Source License

private void fireValueChange(String value) {
    ValueChangeEvent.fire(this, value);
}

From source file:org.openelis.ui.widget.CheckLabel.java

License:Open Source License

/**
 * Sets the value of this widget. Will fire a ValueChangeEvent if fireEvents
 * passed as true and the new value is not equals to old value
 *//*from   ww  w .jav  a  2  s  .  c  om*/
public void setValue(CheckLabelValue value, boolean fireEvents) {

    if (value == null) {
        if (check.getMode() == Check.Mode.TWO_STATE)
            check.uncheck();
        else
            check.unkown();
    } else if ("Y".equals(value.getChecked()))
        check.check();
    else
        check.uncheck();

    if (!Util.isDifferent(value, this.value))
        return;

    this.value = value;

    drawWidget();

    if (fireEvents && !queryMode)
        ValueChangeEvent.fire(this, value);
}

From source file:org.openelis.ui.widget.CheckLabel.java

License:Open Source License

private void fireValueChange(CheckLabelValue value) {
    ValueChangeEvent.fire(this, value);
}

From source file:org.openelis.ui.widget.CheckMenuItem.java

License:Open Source License

public void init() {
    final CheckMenuItem source = this;

    setIcon(css.Unchecked());// w w  w  .  j av a2  s  .  com

    /*
     * Setting this click handler lets the user click anywhere in the menu
     * to toggle the checkbox
     */
    addCommand(new Command() {
        public void execute() {
            setCheck(!checked);
            ValueChangeEvent.fire(source, checked);
        }
    });
}

From source file:org.openelis.ui.widget.Dropdown.java

License:Open Source License

/**
 * Overridden method to set the T value of this widget. Will fire a value
 * change event if fireEvents is true and the value is changed from its
 * current value//from   ww w.ja v  a  2 s.c om
 */
@Override
public void setValue(T value, boolean fireEvents) {
    Integer index;

    if (!Util.isDifferent(this.value == null ? null : this.value, value))
        return;

    table.selectRowAt((index = keyHash.get(value)) != null ? index : -1);

    searchString = "";

    setDisplay();

    this.value = value;

    if (fireEvents)
        ValueChangeEvent.fire(this, value);

}