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:com.tractionsoftware.gwt.user.client.ui.impl.UTCTimeBoxImplHtml5.java

License:Apache License

public void fireValueChangeEvent(Long value) {
    ValueChangeEvent.fire(this, value);
}

From source file:com.tractionsoftware.gwt.user.client.ui.SingleListBox.java

License:Apache License

protected SingleListBox(boolean addMissingValue, boolean isMultipleSelect) {
    super(isMultipleSelect);
    setAddMissingValue(addMissingValue);

    // Listen to our own change events and broadcast as
    // ValueChangeEvent<String>
    addChangeHandler(new ChangeHandler() {
        @Override/*from  w ww.  ja  v  a  2 s .  com*/
        public void onChange(ChangeEvent event) {
            ValueChangeEvent.fire(SingleListBox.this, getValue());
        }
    });
}

From source file:com.tractionsoftware.gwt.user.client.ui.SingleListBox.java

License:Apache License

/**
 * Selects the specified value in the list.
 * /*from  w w w  .java  2 s.  co  m*/
 * @param value the new value
 * @param fireEvents if true, a ValueChangeEvent event will be fired
 * @see #setAddMissingValue
 */
@Override
public void setValue(String value, boolean fireEvents) {
    boolean added = setSelectedValue(this, value, addMissingValue);
    if (added && fireEvents) {
        ValueChangeEvent.fire(this, getValue());
    }
}

From source file:com.turbomanage.gwt.client.ui.widget.SelectOneListBox.java

License:Apache License

@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) {
    // Initialization code
    if (!valueChangeHandlerInitialized) {
        valueChangeHandlerInitialized = true;
        super.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                ValueChangeEvent.fire(SelectOneListBox.this, getValue());
            }/*w  ww . j  a v  a 2  s  . c om*/
        });
    }
    return addHandler(handler, ValueChangeEvent.getType());
}

From source file:com.vaadin.client.ui.VSlider.java

License:Apache License

private void fireValueChanged() {
    ValueChangeEvent.fire(VSlider.this, value);
}

From source file:com.wallissoftware.pushstate.client.PushStateHistorianImpl.java

License:Apache License

private void onPopState(String token) {
    if (setToken(token)) {
        ValueChangeEvent.fire(this, getToken());
    }
}

From source file:com.wallissoftware.pushstate.client.PushStateHistorianImpl.java

License:Apache License

public void newItem(String token, boolean issueEvent, boolean replaceState) {
    if (setToken(token)) {
        if (replaceState) {
            replaceState(relativePath, getToken());
        } else {//from w  ww  . j a  v  a2  s  . c  o m
            pushState(relativePath, getToken());
        }

        if (issueEvent) {
            ValueChangeEvent.fire(this, getToken());
        }
    }

}

From source file:com.wfairclough.foundation4gwt.client.ui.widget.ComboBox.java

License:Apache License

/**
 * {@inheritDoc}/*  w w  w.  j ava2s  .  com*/
 */
public void setValue(String value, boolean fireEvents) {
    String oldValue = getValue();

    for (ComboBoxItem item : getItems()) {
        if (item.getText().equals(value)) {
            item.select();
            break;
        }
    }

    // Don't fire events if value didnt change
    if (oldValue.equals(getValue()))
        return;

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

From source file:com.wfairclough.foundation4gwt.client.ui.widget.ComboBox.java

License:Apache License

/**
 * {@inheritDoc}/*from w w w.j  a v a2  s.  c o m*/
 */
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
    if (!valueChangeHandlerInitialized) {
        addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                ValueChangeEvent.fire(ComboBox.this, getValue());
            }
        });
        valueChangeHandlerInitialized = true;
    }
    return addHandler(handler, ValueChangeEvent.getType());
}

From source file:com.wfairclough.foundation4gwt.client.ui.widget.ProgressBar.java

License:Apache License

/**
 * Set the value of the {@link ProgressBar} with control of event firing.
 * //w  ww  .j a  v a2s.c o  m
 * @param fireEvents true to fire events otherwise false.
 */
public void setValue(Double value, boolean fireEvents) {
    if (fireEvents)
        ValueChangeEvent.fire(this, value);

    this.value = value;
    if (this.value > 100)
        this.value = 100.0d;
    span.getStyle().setWidth(value, Unit.PCT);
}