Package com.google.gwt.dom.client

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


    //The url loaded by this method can be intercepted by
    //WebViewClient.shouldOverrideUrlLoading
    public static void loadUrl(String url) {
    Anchor a = new Anchor("", url);
    RootLayoutPanel.get().add(a);
    NativeEvent event = Document.get().createClickEvent(1, 1, 1, 1, 1, false, false, false, false);
    a.getElement().dispatchEvent(event);
    RootLayoutPanel.get().remove(a);
  }
View Full Code Here


  protected void emulateClickOnBackButton() {
    HTMLPanel current = (HTMLPanel) PageHistory.Instance.current().getWidget();
    HeaderPanel header = (HeaderPanel) current.getWidget(0);
    Button left = header.getLeftButton();
    NativeEvent event = Document.get().createClickEvent(1, 1, 1, 1, 1, false, false, false, false);
    left.getElement().dispatchEvent(event);
  }
View Full Code Here

        }
        try {
          // Only respond to key events on the body element. Otherwise, the key
          // event was probably targeted to some editable input element, and that
          // should own the events.
          NativeEvent realEvent = event.getNativeEvent();
          Element target = realEvent.getEventTarget().cast();
          if (!"body".equals(target.getTagName().toLowerCase())) {
            return;
          }
          // Test that the event is meaningful (and stop bubbling if it is not).
          SignalEvent signal = SignalEventImpl.create(realEvent.<Event>cast(), true);
          if (signal != null) {
            KeyCombo key = EventWrapper.getKeyCombo(signal);
            if (globalHandler.onKeySignal(key)) {
              event.preventDefault();
            }
View Full Code Here

              collapseIf(pe);
            }
            break;
        }

        NativeEvent e = pe.getNativeEvent();

        if (pe.getTypeInt() == KeyNav.getKeyEvent() && expanded) {
          if (e.getKeyCode() == KeyCodes.KEY_ENTER) {
            if (pagingToolBar != null && pagingToolBar.getElement().isOrHasChild(target)) {
              return true;
            }
            e.stopPropagation();
            e.preventDefault();

            if (GXT.isIE()) {
              ignoreNextEnter = true;
            }
View Full Code Here

      }
    }

    @Override
    public void onPreviewNativeEvent(NativePreviewEvent event) {
      NativeEvent e = event.getNativeEvent();
      XElement target = event.getNativeEvent().getEventTarget().cast();
      if ("mousedown".equals(e.getType())) {
        if (GXTLogConfiguration.loggingIsEnabled()) {
          logger.finest("preview mouse down");
        }

        if (!isFocusedWithTarget(parent.<XElement>cast(), target)) {
View Full Code Here

      refreshPreviewHandler = com.google.gwt.user.client.Event.addNativePreviewHandler(new NativePreviewHandler(){
        public void onPreviewNativeEvent(NativePreviewEvent event)
        {
          if (event.getTypeInt() == com.google.gwt.user.client.Event.ONKEYDOWN)
          {
            NativeEvent nEvent = event.getNativeEvent();
            if (nEvent.getCtrlKey() && nEvent.getKeyCode() == 'R')
            {
              nEvent.preventDefault();
            }
           
            if (nEvent.getKeyCode() == 116)//F5
            {
              nEvent.preventDefault();
            }
          }
        }
      });
    }
View Full Code Here

  }

  public void handleEvent(NativeEvent event) {
    int code = event.getKeyCode();

    NativeEvent e = event;

    String type = event.getType();

    if ("keydown".equals(type) && keyEvent == Event.ONKEYDOWN || "keypress".equals(type)
        && keyEvent == Event.ONKEYPRESS) {

    } else {
      return;
    }

    if (component != null && component.getElement() != (Element) e.getCurrentEventTarget().cast()) {
      return;
    }

    if (cancelBubble) {
      event.stopPropagation();
View Full Code Here

  @Override
  protected void onPreviewNativeEvent(NativePreviewEvent event) {
    // We need to preventDefault() on mouseDown events (outside of the
    // DialogBox content) to keep text from being selected when it
    // is dragged.
    NativeEvent nativeEvent = event.getNativeEvent();

    if (!event.isCanceled()
        && (event.getTypeInt() == Event.ONMOUSEDOWN)
        && isCaptionEvent(nativeEvent)) {
      nativeEvent.preventDefault();
    }

    super.onPreviewNativeEvent(event);
  }
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

    public ButtonStateHandler state() {
        return buttonStateHandler;
    }

    public void click() {
        final NativeEvent event = Document.get().createClickEvent(0, 0, 0, 0, 0, false, false, false, false);
        DomEvent.fireNativeEvent(event, this);
    }
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.