Package com.google.gwt.user.client

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


    // abstractions, e.g. ClickHandlers. A typical GWT application would not do this, however,
    // this nicely illustrates how you can develop GWT applications
    // that program directly against the DOM.
    final com.google.gwt.user.client.Element clientToggleElement = toggleAll.cast();
    DOM.sinkEvents(clientToggleElement, Event.ONCLICK);
    DOM.setEventListener(clientToggleElement, new EventListener() {
      @Override
      public void onBrowserEvent(Event event) {
        handler.markAllCompleted(toggleAll.isChecked());
      }
    });
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

      current = bottom;
    }
    Utils.setTransitionDuration(widgetEle, time);
    Utils.setTransitionDuration(this._scrollbar.getFirstChildElement(), time);
    Utils.addEventListenerOnce(this._scrollbar.getFirstChildElement(),
        "webkitTransitionEnd", false, new EventListener() {
          @Override
          public void onBrowserEvent(Event event) {
                hideScrollBar();
          }
        });
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

          //Window.alert("Something got selected " + createdPanel.getValue(selectedIndex));
//          Element element = DOM.getElementById(createdPanel.getValue(selectedIndex));
//          element.getStyle().setBorderWidth(10, Unit.PX);
//          element.getStyle().setBorderStyle(BorderStyle.SOLID);
//          element.getStyle().setBorderColor("black");
          EventListener listener = DOM.getEventListener(DOM.getElementById(createdPanel.getValue(selectedIndex)));
          // No listener attached to the element, so no widget exist for this
          // element
          if (listener instanceof Widget) {
              // GWT uses the widget as event listener
              Widget widget = (Widget) listener ;
              widget.getElement().getStyle().setBorderWidth(10, Unit.PX);
              widget.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
              widget.getElement().getStyle().setBorderColor("black");
             
              selectedWidget = widget;
             
             
              if (widget instanceof FlowPanel) {
                //Label cell4= new Label("FlowPanel D");
            //cell4.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
            //cell4.getElement().getStyle().setBorderColor("blue");
            //cell4.getElement().getStyle().setBorderWidth(5, Unit.PX);
            //((FlowPanel)widget).add(cell4);
               
                ((FlowPanel)widget).getElement().getStyle().setOutlineStyle(OutlineStyle.DOTTED);
                ((FlowPanel)widget).getElement().getStyle().setOutlineWidth(5, Unit.PX);
                ((FlowPanel)widget).getElement().getStyle().setOutlineColor("gray");
                 //Window.alert("FlowPanel ");
               
                for (int i = 0; i < createdPanel.getItemCount(); i++) {
                  if (i != selectedIndex) {
                    EventListener listener2 = DOM.getEventListener(DOM.getElementById(createdPanel.getValue(i)));
                    if (listener2 instanceof Widget) {
                      Widget widget2 = (Widget) listener2 ;
                      ((FlowPanel)widget2).getElement().getStyle().setOutlineStyle(OutlineStyle.NONE);
                    }
                  }
View Full Code Here

   * We will use the fact as GWT use the widget itself as EventListener ! If no Widget associated
   * with the element, this method returns null.
   */
  protected static Widget getAssociatedWidget(Element e) {
    try {
      EventListener listener = DOM.getEventListener((com.google.gwt.user.client.Element) e);
      // No listener attached to the element, so no widget exist for this element
      if (listener == null) {
        return null;
      }
      if (listener instanceof Widget) {
View Full Code Here

      public void storeUpdate(StoreEvent se) {
        onUpdate(ds, se.model);
      }

    };
    headerListener = new EventListener() {

      public void onBrowserEvent(Event event) {
        switch (DOM.eventGetType(event)) {
          case Event.ONMOUSEOVER:
            handleHdOver(event);
            break;
          case Event.ONMOUSEOUT:
            handleHdOut(event);
            break;
          case Event.ONMOUSEMOVE:
            handleHdMove(event);
            break;
          case Event.ONCLICK:
            handleHdDown(event);
            break;
        }
      }

    };

    scrollListener = new EventListener() {
      public void onBrowserEvent(Event event) {
        if (event.getTypeInt() == Event.ONSCROLL) {
          syncScroll();
        }
      }
View Full Code Here

    setElement(wrap.dom, target, index);

    super.onRender(target, index);

    triggerListener = new EventListener() {
      public void onBrowserEvent(Event event) {
        FieldEvent ce = new FieldEvent(TwinTriggerField.this);
        ce.event = event;
        ce.type = DOM.eventGetType(event);
        ce.stopEvent();
View Full Code Here

      trigger.setVisible(false);
    }

    super.onRender(target, index);

    triggerListener = new EventListener() {
      public void onBrowserEvent(Event event) {
        FieldEvent ce = new FieldEvent(TriggerField.this);
        ce.event = event;
        ce.type = DOM.eventGetType(event);
        ce.stopEvent();
View Full Code Here

            innerDiv.getStyle().setMarginLeft( (icon.getWidth() / 2) * -1,
                                               Unit.PX );

            // Setup event handling
            DOM.setEventListener( icon.getElement(),
                                  new EventListener() {

                                      public void onBrowserEvent(Event event) {
                                          if ( event.getType().equals( "click" ) ) {
                                              //Raise event to toggle merging
                                              ToggleMergingEvent tme = new ToggleMergingEvent( !isMerged );
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.