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.eumetsat.usd.gcp.client.slider.SliderBar.java

License:Apache License

/**
 * Set the current value and optionally fire the onValueChange event.
 * //from www  .  ja v  a 2 s .  c o m
 * @param curValue
 *            the current value
 * @param fireEvent
 *            fire the onValue change event if true
 */
public final void setCurrentValue(final double curValue, final boolean fireEvent) {
    // Confine the value to the range
    this.curValue = Math.max(minValue, Math.min(maxValue, curValue));
    double remainder = (this.curValue - minValue) % stepSize;
    this.curValue -= remainder;

    // Go to next step if more than halfway there
    if ((remainder > (stepSize / 2)) && ((this.curValue + stepSize) <= maxValue)) {
        this.curValue += stepSize;
    }

    // Redraw the knob
    drawKnob();

    // Fire the ValueChangeEvent
    if (fireEvent) {
        ValueChangeEvent.fire(this, this.curValue);
    }
}

From source file:org.eurekastreams.web.client.ui.common.autocomplete.ExtendedTextArea.java

License:Apache License

/**
 * Override to get the browser events.//  w w  w  .  ja  va  2 s  . com
 * 
 * @param event
 *            the event that fired
 */
@Override
public void onBrowserEvent(final Event event) {
    super.onBrowserEvent(event);
    switch (event.getTypeInt()) {
    case Event.ONPASTE:
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
            public void execute() {
                ValueChangeEvent.fire(ExtendedTextArea.this, getText());
            }
        });
        break;
    default:
        break;
    }
}

From source file:org.freemedsoftware.gwt.client.widget.AsyncPicklistWidgetBase.java

License:Open Source License

/**
 * Fire ValueChangeHandler classes attached to this object if there are any.
 * /* w  w w .  j  a v  a  2 s .c o m*/
 */
protected void onSelected() {
    // Fire change
    ValueChangeEvent.fire(this, value);
}

From source file:org.guvnor.client.widgets.Toggle.java

License:Apache License

@UiHandler("on")
public void onOnClick(ClickEvent e) {
    setValue(true);
    ValueChangeEvent.fire(this, true);
}

From source file:org.guvnor.client.widgets.Toggle.java

License:Apache License

@UiHandler("off")
public void onOffClick(ClickEvent e) {
    setValue(false);
    ValueChangeEvent.fire(this, false);
}

From source file:org.gwtaf.widgets.generic.RadioButtonGroup.java

License:Apache License

public void setValue(String arg0, boolean arg1) {

    setValue(arg0);
    ValueChangeEvent.fire(RadioButtonGroup.this, getValue());
}

From source file:org.gwtaf.widgets.generic.RadioButtonGroup.java

License:Apache License

public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
    addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(RadioButtonGroup.this, getValue());
        }//from ww  w .java 2  s .  c o m
    });
    return addHandler(handler, ValueChangeEvent.getType());
}

From source file:org.gwtbootstrap3.client.ui.CheckableInputButton.java

License:Apache License

@Override
public void setValue(final Boolean value, final boolean fireEvents) {
    InputElement.as(getElement()).setChecked(value);
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }/*  w w  w.  j a  v  a2s.  c  o m*/
}

From source file:org.gwtbootstrap3.client.ui.CheckableInputButton.java

License:Apache License

private void onChange(final Event evt) {
    ValueChangeEvent.fire(this, getValue());
}

From source file:org.gwtbootstrap3.client.ui.CheckBoxButton.java

License:Apache License

@Override
protected void ensureDomEventHandlers() {
    // Use a ClickHandler since Bootstrap's jQuery does not trigger native
    // change events:
    // http://learn.jquery.com/events/triggering-event-handlers/
    addClickHandler(new ClickHandler() {

        @Override//from ww  w .  java 2s  .c o m
        public void onClick(ClickEvent event) {
            ValueChangeEvent.fire(CheckBoxButton.this, getValue());
        }

    });
}