Package com.google.gwt.user.client

Examples of com.google.gwt.user.client.EventListener


      DOM.setStyleAttribute(image, "height", (int) bounds.getHeight() + "px");
      String oldHref = DOM.getElementAttribute(image, "src");
      // if href has changed, attach a listener to show the image on load
      if (href != null && !href.equals(oldHref)) {
        DOM.sinkEvents(image, Event.ONLOAD | Event.ONERROR);
        DOM.setEventListener(image, new EventListener() {

          private int retries = 5;

          public void onBrowserEvent(Event event) {
            switch (DOM.eventGetType(event)) {
View Full Code Here


        if (registeredEventModes.size() > 0 && !registeredForEvents) {
          registeredForEvents = true;
          registerNonDOMevents(controller);
          if (DOM.getEventListener((com.google.gwt.user.client.Element)docElement) == null) {
            principleEventListener = true;
              DOM.setEventListener((com.google.gwt.user.client.Element) docElement, new EventListener() {
                  public void onBrowserEvent(Event event) {
 
                      EventTarget eTarget = event.getEventTarget();
                      Node eventNode;
                      if (Node.is(eTarget)) {
View Full Code Here

        }
        doSyncContent(original, copy);
    }

    private void doSyncContent(Element original, Element copy) {
        EventListener eventListener = Event.getEventListener(original);
        if (eventListener instanceof DragImageModifier) {
            ((DragImageModifier) eventListener).modifyDragImage(copy);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static <T> T findWidget(Element element,
            Class<? extends Widget> class1) {
        if (element != null) {
            /* First seek for the first EventListener (~Widget) from dom */
            EventListener eventListener = null;
            while (eventListener == null && element != null) {
                eventListener = Event.getEventListener(element);
                if (eventListener == null) {
                    element = element.getParentElement();
                }
View Full Code Here

      target = (child == null) ? parent : child;
    }

    // Pass the event to the cell.
    final MockValueUpdater valueUpdater = new MockValueUpdater();
    Event.setEventListener(parent, new EventListener() {
      public void onBrowserEvent(Event event) {
        try {
          DOM.setEventListener(parent, null);
          Context context = new Context(0, 0, DEFAULT_KEY);
          cell.onBrowserEvent(context, parent, value, event, valueUpdater);
View Full Code Here

    // Pass the event to the cell.
    final MockValueUpdater valueUpdater = new MockValueUpdater();
    final AbstractEditableCell<T, V> cell = createCell();
    cell.setViewData(DEFAULT_KEY, viewData);
    Event.setEventListener(parent, new EventListener() {
      public void onBrowserEvent(Event event) {
        try {
          DOM.setEventListener(parent, null);
          Context context = new Context(0, 0, DEFAULT_KEY);
          cell.onBrowserEvent(context, parent, value, event, valueUpdater);
View Full Code Here

   * @return the containing element, or null if there is no widget
   */
  public static Widget getWidgetWithElement(Element element) {
    assert element != null : "Cannot find a widget for a null element";
    do {
      EventListener eventListener = DOM.getEventListener(element);
      if (eventListener instanceof Widget) {
        return (Widget) eventListener;
      }
      element = element.getParentElement();
    } while (element != null);
View Full Code Here

      ImageElement imageE=Document.get().createImageElement();
      imageE.setSrc(imgRes.getSafeUri().asString());
      final SpriteSheet toReturn=new SpriteSheet(imageE);
     
      Event.sinkEvents(imageE, Event.ONLOAD|Event.ONERROR);
      Event.setEventListener(imageE, new EventListener(){

        @Override
        public void onBrowserEvent(Event event) {
          if(event.getTypeInt()==Event.ONLOAD){
            assetOnLoad(toReturn);
View Full Code Here

     */
    public static <T> T findWidget(Element element,
            Class<? extends Widget> class1) {
        if (element != null) {
            /* First seek for the first EventListener (~Widget) from dom */
            EventListener eventListener = null;
            while (eventListener == null && element != null) {
                eventListener = Event.getEventListener(element);
                if (eventListener == null) {
                    element = (Element) element.getParentElement();
                }
View Full Code Here

    preview.setAutoHide(false);
    el.addEventsSunk(Event.ONMOUSEDOWN | Event.ONMOUSEOUT | Event.ONMOUSEOVER);
  }

  public void doAttach() {
    DOM.setEventListener(el.dom, new EventListener() {
      public void onBrowserEvent(Event event) {
        switch (event.getTypeInt()) {
          case Event.ONMOUSEDOWN:
            event.stopPropagation();
            event.preventDefault();
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.EventListener

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.