Example usage for com.google.gwt.event.logical.shared ValueChangeHandler onValueChange

List of usage examples for com.google.gwt.event.logical.shared ValueChangeHandler onValueChange

Introduction

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

Prototype

void onValueChange(ValueChangeEvent<T> event);

Source Link

Document

Called when ValueChangeEvent is fired.

Usage

From source file:com.arondor.common.reflection.gwt.client.view.EnumListView.java

License:Apache License

public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<String> valueChangeHandler) {
    return enumListInput.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            if (enumListInput.getSelectedIndex() != -1) {
                String value = enumListInput.getValue(enumListInput.getSelectedIndex());
                setActive(true);//w ww  .jav  a 2  s. c o  m
                valueChangeHandler.onValueChange(new MyValueChangeEvent<String>(value));
            }
        }
    });
}

From source file:com.arondor.common.reflection.gwt.client.view.fields.PrimitiveBooleanView.java

License:Apache License

public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<String> valueChangeHandler) {
    return checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            setActive(true);/*w ww  .  j  ava2 s . c  o  m*/
            valueChangeHandler.onValueChange(new MyValueChangeEvent<String>(event.getValue().toString()));
        }
    });
}

From source file:com.arondor.common.reflection.gwt.client.view.fields.PrimitiveStringView.java

License:Apache License

public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<String> valueChangeHandler) {
    return textBox.addValueChangeHandler(new ValueChangeHandler<String>() {
        public void onValueChange(ValueChangeEvent<String> event) {
            setActive(true);//w w w . jav a 2 s .  c om
            valueChangeHandler.onValueChange(event);
        }
    });
}

From source file:com.arondor.common.reflection.gwt.client.view.fields.StringListView.java

License:Apache License

public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<List<String>> valueChangeHandler) {
    return textArea.addValueChangeHandler(new ValueChangeHandler<String>() {
        public void onValueChange(ValueChangeEvent<String> event) {
            setActive(true);//from www . ja  v  a  2  s  .c om
            String[] splitted = event.getValue().split("\n");
            List<String> values = new ArrayList<String>();
            for (String value : splitted) {
                values.add(value);
            }
            valueChangeHandler.onValueChange(new MyValueChangeEvent<List<String>>(values));
        }
    });
}

From source file:com.arondor.common.reflection.gwt.client.view.ImplementingClassView.java

License:Apache License

public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<String> valueChangeHandler) {
    return implementingListInput.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            if (implementingListInput.getSelectedIndex() != -1) {
                String value = implementingListInput.getValue(implementingListInput.getSelectedIndex());
                selectedClass = value;/*from  www .  ja  va2  s.  co  m*/
                valueChangeHandler.onValueChange(new MyValueChangeEvent<String>(value));
            }
        }
    });
}

From source file:com.google.code.p.gwtchismes.client.GWTCIntervalSelector.java

License:Apache License

/**
 * Configure the default listeners for the elements of this interval selector
 *//*from   w ww.j a v a2  s . co m*/
protected void initListeners() {
    checkinCalendar.addValueChangeHandler(new ValueChangeHandler<GWTCSimpleDatePicker>() {
        public void onValueChange(ValueChangeEvent<GWTCSimpleDatePicker> event) {
            checkinCalendar.hide();
            updateTextElementsFromCheckin();
            for (ValueChangeHandler<GWTCIntervalSelector> change : changeHandlers) {
                change.onValueChange(changeEvent);
            }
        }

    });

    checkoutCalendar.addValueChangeHandler(new ValueChangeHandler<GWTCSimpleDatePicker>() {
        public void onValueChange(ValueChangeEvent<GWTCSimpleDatePicker> event) {
            checkoutCalendar.hide();
            updateTextElementsFromCheckout();
            for (ValueChangeHandler<GWTCIntervalSelector> change : changeHandlers) {
                change.onValueChange(changeEvent);
            }
        }
    });

    nightsListBox.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            for (ValueChangeHandler<GWTCIntervalSelector> change : changeHandlers) {
                change.onValueChange(changeEvent);
            }
        }
    });

    checkinButton.addClickHandler(clickListener);
    checkinDateValue.addClickHandler(clickListener);
    checkinWeekValue.addClickHandler(clickListener);

    changeCheckinLink.addClickHandler(clickListener);

    checkoutButton.addClickHandler(clickListener);
}

From source file:com.google.code.p.gwtchismes.client.GWTCSimpleDatePicker.java

License:Apache License

@SuppressWarnings("deprecation")
public void onClick(ClickEvent event) {
    if (event.getSource() instanceof CellHTML) {
        CellHTML cell = (CellHTML) event.getSource();
        if (cell.isEnabled()) {
            Date d = cell.getDate() != null ? cell.getDate()
                    : new Date(cursorDate.getYear(), cursorDate.getMonth(), cell.getDay());
            setSelectedDate(d);//from www.j  a v  a  2s  .  co  m
            for (ValueChangeHandler<GWTCSimpleDatePicker> change : valueChanges) {
                change.onValueChange(valueChangeEvent);
            }
        }
    } else if (event.getSource() instanceof HasClickHandlers) {
        ((HasClickHandlers) event.getSource()).fireEvent(event);
    } else {
        System.out.println("GWTCSimpleDatePicker.onClidk, unkown type: " + event.getSource().getClass());
    }
}

From source file:com.google.mobile.trippy.web.client.base.DefaultUtils.java

License:Apache License

@Override
public void startCheckOnlineTimer() {
    if (onlineCheckTimer == null) {
        onlineCheckTimer = new Timer() {
            @Override//from  w ww . j  a v a 2s .c  om
            public void run() {
                // Check online state

                if (online == null || online != isOnline()) {
                    online = isOnline();
                    ValueChangeEvent<Boolean> e = new ValueChangeEvent<Boolean>(online) {
                    };
                    for (ValueChangeHandler<Boolean> handler : handlers) {
                        handler.onValueChange(e);
                    }
                }
            }
        };
    }
    onlineCheckTimer.run();
    // Schedule the timer to run every 5 seconds.
    onlineCheckTimer.scheduleRepeating(5000);
}

From source file:gwt.material.design.addins.client.autocomplete.MaterialAutoComplete.java

License:Apache License

@Override
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<List<? extends Suggestion>> handler) {
    return addHandler(new ValueChangeHandler<List<? extends Suggestion>>() {
        @Override//  w w w.j a v a 2s.  co  m
        public void onValueChange(ValueChangeEvent<List<? extends Suggestion>> event) {
            if (isEnabled()) {
                handler.onValueChange(event);
            }
        }
    }, ValueChangeEvent.getType());
}

From source file:gwt.material.design.client.base.BaseCheckBox.java

License:Apache License

@Override
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<Boolean> handler) {
    // Is this the first value change handler? If so, time to add handlers
    if (!valueChangeHandlerInitialized) {
        ensureDomEventHandlers();/*from   w ww  .ja  va2  s  .  c o m*/
        valueChangeHandlerInitialized = true;
    }
    return addHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (isEnabled()) {
                handler.onValueChange(event);
            }
        }
    }, ValueChangeEvent.getType());
}