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.nuxeo.opensocial.container.client.ui.CustomListBox.java

License:Open Source License

public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
    if (!valueChangeHandlerInitialized) {
        valueChangeHandlerInitialized = true;
        addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                ValueChangeEvent.fire(CustomListBox.this, getValue());
            }//from  w w w . ja  v a  2  s.  com
        });
    }
    return addHandler(handler, ValueChangeEvent.getType());
}

From source file:org.obiba.opal.web.gwt.app.client.ui.RadioGroup.java

License:Open Source License

public HandlerRegistration addButton(HasValue<Boolean> button, T value) {
    if (buttons.size() != values.size())
        throw new IllegalStateException("buttons and values are out of sync");

    buttons.add(button);//from   w  w  w.java 2 s. c  o m
    values.add(value);

    final int index = buttons.size() - 1;

    return button.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (currentSelection == null || currentSelection != index) {
                currentSelection = index;
                ValueChangeEvent.fire(RadioGroup.this, getValue());
            }
        }
    });
}

From source file:org.opencms.acacia.client.CmsValidationHandler.java

License:Open Source License

/**
 * Displays the given error messages within the form.<p>
 *
 * @param entityId the entity id//ww w . j  av a  2  s .  co  m
 * @param validationResult the validationResult
 */
public void displayValidation(String entityId, CmsValidationResult validationResult) {

    if (m_formTabPanel != null) {
        CmsAttributeHandler.clearErrorStyles(m_formTabPanel);
    }
    if (validationResult.hasWarnings(entityId)) {
        for (Entry<String[], String> warning : validationResult.getWarnings(entityId).entrySet()) {
            String[] pathElements = warning.getKey();
            // check if there are no errors for this attribute
            if (!validationResult.hasErrors(entityId)
                    || !validationResult.getErrors(entityId).containsKey(pathElements)) {
                CmsAttributeHandler handler = m_rootHandler.getHandlerByPath(pathElements);
                if (handler != null) {
                    String attributeName = pathElements[pathElements.length - 1];
                    handler.setWarningMessage(CmsContentDefinition.extractIndex(attributeName),
                            warning.getValue(), m_formTabPanel);
                }
            }
        }
    }
    if (validationResult.hasErrors(entityId)) {
        for (Entry<String[], String> error : validationResult.getErrors(entityId).entrySet()) {
            String[] pathElements = error.getKey();
            CmsAttributeHandler handler = m_rootHandler.getHandlerByPath(pathElements);
            if (handler != null) {
                String attributeName = pathElements[pathElements.length - 1];
                handler.setErrorMessage(CmsContentDefinition.extractIndex(attributeName), error.getValue(),
                        m_formTabPanel);
            }
        }
        m_validationContext.addInvalidEntity(entityId);
    } else {
        m_validationContext.addValidEntity(entityId);
    }
    ValueChangeEvent.fire(this, m_validationContext);
    m_validating = false;
}

From source file:org.opencms.acacia.client.widgets.CmsCalendarWidget.java

License:Open Source License

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

    ValueChangeEvent.fire(this, m_dateBox.getFormValueAsString());
}

From source file:org.opencms.acacia.client.widgets.CmsCategoryWidget.java

License:Open Source License

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

    ValueChangeEvent.fire(this, getValue());

}

From source file:org.opencms.acacia.client.widgets.CmsCheckboxWidget.java

License:Open Source License

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

    ValueChangeEvent.fire(this, m_checkbox.getFormValueAsString());
}

From source file:org.opencms.acacia.client.widgets.CmsColorpickerWidget.java

License:Open Source License

/**
 * Represents a value change event.<p>
 *
 *///from w ww .j  a  v  a 2 s . c  o  m
public void fireChangeEvent() {

    if (m_colorPicker.getFormValueAsString() != null) {
        ValueChangeEvent.fire(this, m_colorPicker.getFormValueAsString());
    }

}

From source file:org.opencms.acacia.client.widgets.CmsComboWidget.java

License:Open Source License

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

    ValueChangeEvent.fire(this, m_comboBox.getFormValueAsString());

}

From source file:org.opencms.acacia.client.widgets.CmsDependentSelectWidget.java

License:Open Source License

/**
 * Represents a value change event.<p>
 * Please edit the blog entry text.//w  ww.j av  a2  s  .c  o  m
 */
public void fireChangeEvent() {

    ValueChangeEvent.fire(this, m_selectBox.getFormValueAsString());

}

From source file:org.opencms.acacia.client.widgets.CmsDisplayWidget.java

License:Open Source License

/**
 * Represents a value change event.<p>
 *
 *///from  w w  w  .  ja va2 s .c  o  m
public void fireChangeEvent() {

    String result = "";
    if (m_textbox.getText() != null) {
        if (!m_textbox.getText().equals(m_default)) {
            result = m_textbox.getText();
        }
    }

    ValueChangeEvent.fire(this, result);

}