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.opencms.gwt.client.ui.input.category.CmsCategoryTree.java

License:Open Source License

/**
 * Represents a value change event.<p>
 */
public void fireValueChange() {

    ValueChangeEvent.fire(this, getAllSelected());
}

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

License:Open Source License

/**
 * @see org.opencms.gwt.client.ui.input.I_CmsStringModel#setValue(java.lang.String, boolean)
 *///from w w  w .j a  v a2 s.c  o m
public void setValue(String value, boolean notify) {

    if (!m_active) {
        m_active = true;
        try {

            boolean changed = !Objects.equal(value, m_value);
            m_value = value;
            if (notify && changed) {
                ValueChangeEvent.fire(this, value);
            }
        } finally {
            m_active = false;
        }
    }

}

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

License:Open Source License

/**
 * Selects a new button and deselects the previously selected one.<p>
 * //www  .j a  v a2 s .c om
 * @param button the button which should be selected 
 */
public void selectButton(CmsRadioButton button) {

    if (m_selectedButton != button) {
        if (m_selectedButton != null) {
            m_selectedButton.setChecked(false);
        }
        if (!button.isChecked()) {
            button.setChecked(true);
        }
        m_selectedButton = button;
        if (m_target != null) {
            ValueChangeEvent.fire(m_target, button.getName());
        }
    }
}

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

License:Open Source License

/**
 * Sets the state of the check box and optionally fires an event.<p>
 *
 * @param state the new state/*  w w  w . j a  va2  s  . co  m*/
 * @param fireEvent true if a ValueChangeEvent should be fired
 */
public void setState(State state, boolean fireEvent) {

    boolean changed = m_state != state;
    m_state = state;
    if (changed) {
        updateStyle();
    }
    if (fireEvent) {
        ValueChangeEvent.fire(this, state);
    }
}

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

License:Open Source License

/**
* Fires the value change event for the location picker.<p>
*
* @param force <code>true</code> to always fire the event
*//*  w  w  w .  j  ava 2 s . c om*/
void fireChangeEventOnPicker(boolean force) {

    String val = m_editValue.toJSONString();
    if (force || (m_currentValue == null) || !val.equals(m_currentValue.toJSONString())) {
        m_currentValue = m_editValue.cloneValue();
        displayValue();
        ValueChangeEvent.fire(m_picker, val);
    }
}

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

License:Open Source License

/**
 * Displays the suggestions supplied from a GetMatchesEvent Handler.
 * /*from w w w  .jav  a 2s . co  m*/
 * @param data
 *        A model for the DropdownWidget to display for matching suggestions.
 */
public void showAutoMatches(ArrayList<TableDataRow> data) {
    selectedRow = -1;
    selectedCol = -1;
    if (data == null || data.size() == 0) {
        data = new ArrayList<TableDataRow>();
        data.add(new TableDataRow(null, ""));
    }
    load(data);
    if (textbox.getStyleName().indexOf("Focus") > -1) {
        selectRow(0);
        view.setHeight(Math.min(maxRows, data.size()) * cellHeight);
        showTable();
    } else if (data != null && data.size() > 0) {
        setValue((T) data.get(0).key, true);
        field.checkValue(this);
        field.drawExceptions(this);
    } else {
        setSelection(null, "");
        field.checkValue(this);
        field.drawExceptions(this);
        if (fireEvents)
            ValueChangeEvent.fire(this, null);
    }

}

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

License:Open Source License

/**
 * Receives notice when this widget loses focus.  Removes the focus style and fires ValuChangeEvent to handlers.
 *//*  ww w  .  j  a  v  a 2  s  . c  o  m*/
public void onBlur(BlurEvent event) {
    textbox.removeStyleName("Focus");
    if (!showingOptions && isEnabled() && !field.queryMode) {
        if ("".equals(textbox.getText()) && field.getValue() != null) {
            setSelection(null, "");
            ValueChangeEvent.fire(this, null);
        } else {
            setValue(getValue(), true);
        }
        checkValue();
    }
}

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

License:Open Source License

public void setValue(Datetime value, boolean fireEvents) {
    Datetime old = form.date;//from w  ww.j av a  2s .c om
    form.date = value;
    if (fireEvents)
        ValueChangeEvent.fire(this, getValue());

}

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

License:Open Source License

public void setValue(Datetime value, boolean fireEvents) {
    if (queryMode) {
        queryString = getString(value);//from   ww w.  j  a v  a2  s  .c  om
        validateQuery();
    } else {
        if (DataBaseUtil.isDifferent(this.value, value)) {
            this.value = value;
            if (fireEvents)
                ValueChangeEvent.fire(this, getValue());
        }
    }

}

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

License:Open Source License

private void doBlur() {
    if (noBlur) {
        noBlur = false;/*from w  w w.j a  va  2  s  .  c o m*/
        return;
    }

    String textValue = getTextBoxDisplay();

    textbox.setText(textValue.trim());

    hideTable();
    field.setValue(getValue());
    ValueChangeEvent.fire(this, getValue());
    field.clearExceptions(this);
    checkValue();
    activeWidget = null;
}