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.wfairclough.foundation4gwt.client.ui.widget.RadioButton.java

License:Apache License

/**
 * {@inheritDoc}//www .  j  av  a 2 s  .co m
 */
public void setValue(Boolean enabled, boolean fireEvents) {
    if (enabled == null)
        enabled = Boolean.FALSE;

    Boolean oldValue = getValue();

    if (oldValue.equals(enabled))
        return;

    if (enabled) {
        radioSpan.getElement().addClassName(Constants.CHECKED);
    } else {
        radioSpan.getElement().removeClassName(Constants.CHECKED);
    }

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

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

License:Apache License

protected void ensureDomEventHandlers() {
    addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            ValueChangeEvent.fire(Switch.this, getValue());
        }/*w  w w.j av  a2  s. co m*/
    });
}

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

License:Apache License

/**
 * {@inheritDoc}//from   w ww  .  j a va2 s  .  c  om
 */
public void setValue(Boolean enabled, boolean fireEvents) {
    if (enabled == null)
        enabled = Boolean.FALSE;

    Boolean oldValue = getValue();

    if (enabled) {
        onInput.getElement().setAttribute(Constants.CHECKED, "");
        offInput.getElement().removeAttribute(Constants.CHECKED);
    } else {
        onInput.getElement().removeAttribute(Constants.CHECKED);
        offInput.getElement().setAttribute(Constants.CHECKED, "");
    }

    if (oldValue.equals(enabled))
        return;

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

From source file:com.wrupple.muba.desktop.client.activity.widgets.fields.colorPicker.ColorPicker.java

License:Artistic License

@Override
public void setValue(String value, boolean fireEvents) {
    setValue(value);//w  w  w  . jav a  2s .  co  m
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }
}

From source file:cz.incad.kramerius.editor.share.GWTRelationKindModel.java

License:Open Source License

void setModified(boolean modified) {
    this.modified = modified;
    ValueChangeEvent.fire(this, this);
}

From source file:cz.incad.kramerius.editor.share.GWTRelationModel.java

License:Open Source License

private void fireModifiedEvent() {
    ValueChangeEvent.fire(this, this);
}

From source file:de.knightsoftnet.validators.client.editor.impl.AbstractBeanValidationEditorDriver.java

License:Apache License

/**
 * default constructor.//w  w w.  j  a  v  a2s. c o  m
 */
public AbstractBeanValidationEditorDriver() {
    super();
    this.commitOnReturnHandler = new KeyPressHandler() {
        @Override
        public void onKeyPress(final KeyPressEvent pevent) {
            if (pevent.getCharCode() == KeyCodes.KEY_ENTER
                    || pevent.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                AbstractBeanValidationEditorDriver.this.tryToSubmitFrom();
            }
        }
    };
    this.validateOnKeyUpHandler = new KeyUpHandler() {
        @Override
        public void onKeyUp(final KeyUpEvent pevent) {
            AbstractBeanValidationEditorDriver.this.validate();
        }
    };
    this.validateOnVueChangeHandler = new ValueChangeHandler<Object>() {
        @Override
        public void onValueChange(final ValueChangeEvent<Object> pevent) {
            AbstractBeanValidationEditorDriver.this.validate();
        }
    };
    this.valueChangeHandler = new ValueChangeHandler<Object>() {
        @Override
        public void onValueChange(final ValueChangeEvent<Object> pevent) {
            ValueChangeEvent.fire(AbstractBeanValidationEditorDriver.this,
                    AbstractBeanValidationEditorDriver.this.getObject());
        }
    };
}

From source file:de.swm.commons.mobile.client.widgets.DropDownList.java

License:Apache License

@Override
public void onChange(ChangeEvent event) {
    ValueChangeEvent.fire(this, getValue());
}

From source file:de.swm.commons.mobile.client.widgets.FlipSwitch.java

License:Apache License

/**
 * Manually sets the value.//from www . j  a v a  2  s .  c o  m
 * 
 * @param value
 *            the new value
 * @param forceUpdateFlipPosition
 *            tue updated the position
 * @param duration
 *            the duration af the animation in ms
 */
private void setValue(boolean value, boolean forceUpdateFlipPosition, int duration, boolean fireEvents) {
    if (myValue != value) {
        myValue = value;
        updateFlipPosition(duration);
        if (fireEvents) {
            ValueChangeEvent.fire(this, myValue);
        }
    } else if (forceUpdateFlipPosition) {
        updateFlipPosition(duration);
    }
}

From source file:de.swm.commons.mobile.client.widgets.SlidePanel.java

License:Apache License

/**
 * Moves to the next slide without boundary checks.
 *//*  ww w . j  av  a2  s.c o m*/
protected void moveNext() {
    Slide to = getSlide(myCurrent);
    Slide from = (Slide) contentPanel.getWidget(0);
    Transition transition = Transition.SLIDE;
    ValueChangeEvent.fire(this, true);
    transition.start(from, to, contentPanel, false);
}