Exemple #1
0
 @Override
 public HandlerRegistration addValueChangeHandler(ValueChangeHandler<List<M>> handler) {
   if (!valueChangeHandlerInitialized) {
     valueChangeHandlerInitialized = true;
     addDomHandler(
         new ChangeHandler() {
           @Override
           public void onChange(ChangeEvent event) {
             ValueChangeEvent.fire(ListWidget.this, getValue());
           }
         },
         ChangeEvent.getType());
   }
   return addHandler(handler, ValueChangeEvent.getType());
 }
  public InputWidget(String type) {
    super(DOM.createElement("input"));
    getElement().setAttribute("type", type);

    // fire a change event on change or blur
    addDomHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            fireValueChangeHandler(getValue());
          }
        },
        ChangeEvent.getType());

    addBlurHandler(
        new BlurHandler() {
          @Override
          public void onBlur(BlurEvent event) {
            fireValueChangeHandler(getValue());
          }
        });
  }
  @Override
  public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
    if (!changeHandlerAdded) {
      changeHandlerAdded = true;
      this.codeMirror.on(
          this.editorOverlay,
          CHANGE,
          new EventHandlers.EventHandlerOneParameter<CMChangeEventOverlay>() {

            @Override
            public void onEvent(final CMChangeEventOverlay param) {
              LOG.fine(
                  "Change event - state clean="
                      + editorOverlay.getDoc().isClean(getGenerationMarker())
                      + " (generation="
                      + getGenerationMarker()
                      + ").");
              fireChangeEvent();
            }
          });
    }
    return addHandler(handler, ChangeEvent.getType());
  }
Exemple #4
0
 @Override
 public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
   return handlerManager_.addHandler(ChangeEvent.getType(), handler);
 }
Exemple #5
0
 public HandlerRegistration addChangeHandler(ChangeHandler handler) {
   return addDomHandler(handler, ChangeEvent.getType());
 }