Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.NativeEvent


    private void keyboardNavigation(Event event) {
      int code = DOM.eventGetKeyCode(event);
      switch (code) {
      case KeyCodes.KEY_ENTER: {
        NativeEvent nativeEvent =
          Document.get().createClickEvent(
            0,
            0,
            0,
            0,
View Full Code Here


    // NOTE: we should only be in the popped state for previewing events
    // assert isPopped() == true; (commented out for performance - but asserts
    // ok)

    final int type = event.getTypeInt();
    final NativeEvent ne = event.getNativeEvent();
    final Element target = Element.as(ne.getEventTarget());
    final boolean eventTargetsPopup = getElement().isOrHasChild(target);

    switch(type) {
      case Event.ONMOUSEDOWN:
        // We need to preventDefault() on mouseDown events (outside of the
        // DialogBox content) to keep text from being selected when it
        // is dragged.
        if(target.isOrHasChild(dragTarget)) {
          // Log.debug("ViewContainer.onPreviewNativeEvent() - preventing default..");
          ne.preventDefault();
        }
      case Event.ONMOUSEUP:
      case Event.ONMOUSEMOVE:
      case Event.ONCLICK:
      case Event.ONDBLCLICK: {
View Full Code Here

      this.rowIndex = row;
      setOptions(delegate.getOptions(row));
    }

    if(!isShowing()) {
      final NativeEvent ne = event.getNativeEvent();
      showAt(ne.getClientX(), ne.getClientY());
    }
  }
View Full Code Here

      return table;
    }

    @Override
    public void onCellPreview(CellPreviewEvent<T> event) {
      NativeEvent nativeEvent = event.getNativeEvent();
      String eventType = event.getNativeEvent().getType();
      if (BrowserEvents.KEYDOWN.equals(eventType) && !event.isCellEditing()) {
        /*
         * Handle keyboard navigation, unless the cell is being edited. If the
         * cell is being edited, we do not want to change rows.
         *
         * Prevent default on navigation events to prevent default scrollbar
         * behavior.
         */
        int oldRow = table.getKeyboardSelectedRow();
        int oldColumn = table.getKeyboardSelectedColumn();
        boolean isRtl = LocaleInfo.getCurrentLocale().isRTL();
        int keyCodeLineEnd = isRtl ? KeyCodes.KEY_LEFT : KeyCodes.KEY_RIGHT;
        int keyCodeLineStart = isRtl ? KeyCodes.KEY_RIGHT : KeyCodes.KEY_LEFT;
        int keyCode = nativeEvent.getKeyCode();
        if (keyCode == keyCodeLineEnd) {
          int nextColumn = findInteractiveColumn(oldColumn, false);
          if (nextColumn <= oldColumn) {
            // Wrap to the next row.
            table.setKeyboardSelectedRow(oldRow + 1);
View Full Code Here

    // synchronous, so we simply set and clear the flag within this method.
    allowClick = true;

    // Mouse coordinates are not always available (e.g., when the click is
    // caused by a keyboard event).
    NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
        false, false, false);
    getElement().dispatchEvent(evt);

    allowClick = false;
  }
View Full Code Here

         * See if it is a child LI tag within ui-timepicker-div because all times are in <LI>
         */
        if (DOM.isOrHasChild(DOM.getElementById(m_timePickerDivId), target) &&
                "LI".equalsIgnoreCase(target.getTagName())) {

            NativeEvent nativeEvent = Document.get().createChangeEvent();
            ChangeEvent.fireNativeEvent(nativeEvent, this);
           
            return;
        }
    }
View Full Code Here

         */
        if (DOM.getElementById("ui-datepicker-div") != null &&
            DOM.isOrHasChild(DOM.getElementById("ui-datepicker-div"), target) &&
                "A".equalsIgnoreCase(target.getTagName())) {

            NativeEvent nativeEvent = Document.get().createChangeEvent();
            ChangeEvent.fireNativeEvent(nativeEvent, this);

            return;
        }
    }
View Full Code Here

    }

    public static void simulateClickFromTouchEvent(Event touchevent,
            Widget widget) {
        Touch touch = touchevent.getChangedTouches().get(0);
        final NativeEvent createMouseUpEvent = Document.get()
                .createMouseUpEvent(0, touch.getScreenX(), touch.getScreenY(),
                        touch.getClientX(), touch.getClientY(), false, false,
                        false, false, NativeEvent.BUTTON_LEFT);
        final NativeEvent createMouseDownEvent = Document.get()
                .createMouseDownEvent(0, touch.getScreenX(),
                        touch.getScreenY(), touch.getClientX(),
                        touch.getClientY(), false, false, false, false,
                        NativeEvent.BUTTON_LEFT);
        final NativeEvent createMouseClickEvent = Document.get()
                .createClickEvent(0, touch.getScreenX(), touch.getScreenY(),
                        touch.getClientX(), touch.getClientY(), false, false,
                        false, false);

        /*
 
View Full Code Here

     * @see
     * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google
     * .gwt.event.dom.client.KeyPressEvent)
     */
    public void onKeyPress(KeyPressEvent event) {
        NativeEvent nativeEvent = event.getNativeEvent();
        int keyCode = nativeEvent.getKeyCode();
        if (keyCode == 0 && nativeEvent.getCharCode() == ' ') {
            // Provide a keyCode for space to be compatible with FireFox
            // keypress event
            keyCode = CHARCODE_SPACE;
        }
        if (handleKeyNavigation(keyCode, event.isControlKeyDown()
View Full Code Here

        disallowNextClick = false;

        // Mouse coordinates are not always available (e.g., when the click is
        // caused by a keyboard event).
        NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
                false, false, false);
        getElement().dispatchEvent(evt);
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.NativeEvent

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.