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

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

Introduction

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

Prototype

public static <T> void fireIfNotEqual(HasValueChangeHandlers<T> source, T oldValue, T newValue) 

Source Link

Document

Fires value change event if the old value is not equal to the new value.

Usage

From source file:org.opencms.gwt.client.ui.input.CmsSimpleTextBox.java

License:Open Source License

/**
 * Triggered on key press to fire event if the value changed.<p>
 *//*w ww.  ja  v a2  s  . co m*/
void fireChange() {

    ValueChangeEvent.fireIfNotEqual(this, m_previousValue, getValue());
    m_previousValue = getValue();
}

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

License:Open Source License

/**
 * Sets the current value of the widget and fires a ValueChangeEvent to any registered handlers
 * if the fireEvents param is passed as true.
 *///from   ww  w  .  j av a2s.  com
public void setValue(T value, boolean fireEvents) {
    T old = field.getValue();
    setSelection(value);
    field.setValue(value);
    if (fireEvents)
        ValueChangeEvent.fireIfNotEqual(this, old, value);
}

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

License:Open Source License

public void setValue(String value, boolean fireEvents) {
    String old = getState();/*from  w ww. ja va2  s . c om*/
    setState(value);
    if (fireEvents)
        ValueChangeEvent.fireIfNotEqual(this, old, value);
    else
        field.setValue(value);
}

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

License:Open Source License

public void setValue(T value, boolean fireEvents) {
    T old = getValue();/* ww w  .j  av a2 s.c om*/
    setSelection(value);
    if (fireEvents)
        ValueChangeEvent.fireIfNotEqual(this, old, value);
}

From source file:org.openelis.gwt.widget.EditBox.java

License:Open Source License

public void setValue(String value, boolean fireEvents) {
    String old = getValue();//  w w  w. j  a va  2 s  .com
    text.setText(value);
    if (fireEvents)
        ValueChangeEvent.fireIfNotEqual(this, old, value);

}

From source file:org.openelis.gwt.widget.richtext.RichTextWidget.java

License:Open Source License

public void setValue(String value, boolean fireEvents) {
    String old = area.getHTML();//from   w  w  w . j a  v  a2  s.  com
    area.setHTML(value);
    if (fireEvents)
        ValueChangeEvent.fireIfNotEqual(this, old, value);
}

From source file:org.overlord.commons.gwt.client.local.widgets.Pager.java

License:Apache License

/**
 * Fires a value change event.  This is called when the user clicks
 * on one of the pages in the pager./*from  w  w  w . jav a2s. c o  m*/
 * @param oldValue
 * @param newValue
 */
protected void fireValueChangeEvent(int oldValue, int newValue) {
    ValueChangeEvent.fireIfNotEqual(this, oldValue, newValue);
}

From source file:org.overlord.dtgov.ui.client.local.pages.deployments.DeploymentContentsFilters.java

License:Apache License

/**
 * Called whenever any filter value changes.
 *//*from   w ww.  ja  v a2 s .c  o m*/
protected void onFilterValueChange() {
    DeploymentContentsFilterBean newState = new DeploymentContentsFilterBean();
    newState.setName(name.getValue()).setType(type.getValue());

    DeploymentContentsFilterBean oldState = this.currentState;
    this.currentState = newState;
    // Only fire a change event if something actually changed.
    ValueChangeEvent.fireIfNotEqual(this, oldState, currentState);
}

From source file:org.overlord.dtgov.ui.client.local.pages.deployments.DeploymentFilters.java

License:Apache License

/**
 * Called whenever any filter value changes.
 *///  w  w w  .j  av a2s  .c o  m
protected void onFilterValueChange() {
    DeploymentsFilterBean newState = new DeploymentsFilterBean();
    newState.setType(type.getValue()).setStage(stage.getValue()).setBundleName(bundleName.getValue())
            .setDateInitiatedFrom(dateInitiatedFrom.getDateValue())
            .setDateInitiatedTo(dateInitiatedTo.getDateValue());

    DeploymentsFilterBean oldState = this.currentState;
    this.currentState = newState;
    // Only fire a change event if something actually changed.
    ValueChangeEvent.fireIfNotEqual(this, oldState, currentState);
}

From source file:org.overlord.dtgov.ui.client.local.pages.deployments.DeploymentFilters.java

License:Apache License

/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *//*from  w w w  .j ava2  s. c om*/
@Override
public void setValue(DeploymentsFilterBean value, boolean fireEvents) {
    type.setValue(value.getType() == null ? "" : value.getType()); //$NON-NLS-1$
    stage.setValue(value.getType() == null ? "" : value.getStage()); //$NON-NLS-1$
    bundleName.setValue(value.getType() == null ? "" : value.getBundleName()); //$NON-NLS-1$
    dateInitiatedFrom.setDateValue(value.getDateInitiatedFrom() == null ? null : value.getDateInitiatedFrom());
    dateInitiatedTo.setDateValue(value.getDateInitiatedTo() == null ? null : value.getDateInitiatedTo());
    DeploymentsFilterBean oldState = this.currentState;
    currentState = value;
    if (fireEvents) {
        ValueChangeEvent.fireIfNotEqual(this, oldState, currentState);
    }
}