Package com.google.gwt.events.client

Examples of com.google.gwt.events.client.EventListenerRemover


        windowDomainRight, resources, serverEventController);
  }

  @Override
  public EventListenerRemover addMouseOutListener(MouseOutListener listener) {
    EventListenerRemover remover = super.addMouseOutListener(listener);
    removers.add(remover);
    return remover;
  }
View Full Code Here


    return remover;
  }

  @Override
  public EventListenerRemover addMouseOverListener(MouseOverListener listener) {
    EventListenerRemover remover = super.addMouseOverListener(listener);
    removers.add(remover);
    return remover;
  }
View Full Code Here

    }
  }

  private static EventListenerRemover addEventListeners() {
    final JSOArray<Handler> stack = JSOArray.create();
    final EventListenerRemover downRemover = Event.addEventListener(
        KeyDownEvent.NAME, Document.get(), new EventListener() {
          public void handleEvent(Event event) {
            final Data data = handlers.get(event.getKeyCode());
            if (data == null || !event.getCtrlKey()) {
              return;
            }
            Handler handler = data.getHandler();
            handler.onKeyDown(new KeyDownEvent(handler, event));
            stack.push(handler);
            event.preventDefault();
          }
        });

    final EventListenerRemover upRemover = Event.addEventListener(
        KeyUpEvent.NAME, Document.get(), new EventListener() {
          public void handleEvent(Event event) {
            if (stack.peek() == null) {
              return;
            }

            final Handler handler = stack.pop();
            handler.onKeyUp(new KeyUpEvent(handler, event));
          }
        });

    return new EventListenerRemover() {
      public void remove() {
        downRemover.remove();
        upRemover.remove();
      }
    };
  }
View Full Code Here

      final ChangeListener listener) {
    if (listeners == null) {
      listeners = new ArrayList<ChangeListener>();
    }
    listeners.add(listener);
    return new EventListenerRemover() {
      public void remove() {
        listeners.remove(listener);
      }
    };
  }
View Full Code Here

    }
  }

  public EventListenerRemover getRemover() {
    if (remover == null) {
      remover = new EventListenerRemover() {
        public void remove() {
          for (int i = 0, n = removeHandles.size(); i < n; i++) {
            removeHandles.get(i).remove();
          }
          removeHandles.clear();
View Full Code Here

    if (listeners == null) {
      listeners = new ArrayList<WidgetEventListener>();
    }

    listeners.add(listener);
    return new EventListenerRemover() {
      public void remove() {
        listeners.remove(listener);
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.events.client.EventListenerRemover

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.