Package org.jboss.errai.otec.client

Examples of org.jboss.errai.otec.client.ListenerRegistration


            }.schedule(1);
          }
        }
    );

    final ListenerRegistration listenerRegistration
        = entity.getState().addStateChangeListener(new StateChangeListener() {
      @Override
      public int getCursorPos() {
        return widget.getCursorPos();
      }

      @Override
      public void onStateChange(final int newCursorPos, final Object newValue) {
        if (NO_PROPAGATE_STATE_CHANGE) {
          return;
        }

        widget.setValue(newValue, false);
        widget.setCursorPos(newCursorPos);
      }
    });

    DOM.sinkEvents(widget.getElement(), DOM.getEventsSunk(widget.getElement()) | Event.ONPASTE);

    final Timer timer = new Timer() {
      @Override
      public void run() {
        entityChangeStream.flush();
      }
    };
    timer.scheduleRepeating(500);

    return new AtomizerSession() {
      @Override
      public void end() {
        entityChangeStream.close();
        timer.cancel();

        logger.info("END ATOMIZER SESSION");
        entityStreamRegistration.remove();
        listenerRegistration.remove();
        final Collection<HandlerRegistration> values = HANDLER_REGISTRATION_MAP.values();
        for (final HandlerRegistration value : values) {
          value.removeHandler();
        }
      }
View Full Code Here


            }.schedule(1);
          }
        }
    );

    final ListenerRegistration listenerRegistration
        = entity.getState().addStateChangeListener(new StateChangeListener() {
      @Override
      public int getCursorPos() {
        return widget.getCursorPos();
      }

      @Override
      public void onStateChange(final int newCursorPos, final Object newValue) {
        if (NO_PROPAGATE_STATE_CHANGE) {
          return;
        }

        widget.setValue(newValue, false);
        widget.setCursorPos(newCursorPos);
      }
    });

    DOM.sinkEvents(widget.getElement(), DOM.getEventsSunk(widget.getElement()) | Event.ONPASTE);

    final Timer timer = new Timer() {
      @Override
      public void run() {
        entityChangeStream.flush();
      }
    };
    timer.scheduleRepeating(500);

    return new AtomizerSession() {
      @Override
      public void end() {
        entityChangeStream.close();
        timer.cancel();

        LogUtil.log("END ATOMIZER SESSION");
        entityStreamRegistration.remove();
        listenerRegistration.remove();
        final Collection<HandlerRegistration> values = HANDLER_REGISTRATION_MAP.values();
        for (final HandlerRegistration value : values) {
          value.removeHandler();
        }
      }
View Full Code Here

TOP

Related Classes of org.jboss.errai.otec.client.ListenerRegistration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.