Package com.google.gwt.user.client.Event

Examples of com.google.gwt.user.client.Event.NativePreviewHandler


        final int eventType = Event.as(startEvent).getTypeInt();
        if (handleDragEvents
                && (eventType == Event.ONMOUSEDOWN || eventType == Event.ONTOUCHSTART)) {
            // only really start drag event on mousemove
            deferredStartRegistration = Event
                    .addNativePreviewHandler(new NativePreviewHandler() {

                        private int startX = Util
                                .getTouchOrMouseClientX(currentDrag
                                        .getCurrentGwtEvent());
                        private int startY = Util
View Full Code Here


        Roles.getDialogRole().setAriaLabelledbyProperty(getElement(),
                Id.of(headerText));

        // Handlers to Prevent tab to leave the window
        // and backspace to cause browser navigation
        topEventBlocker = new NativePreviewHandler() {
            @Override
            public void onPreviewNativeEvent(NativePreviewEvent event) {
                NativeEvent nativeEvent = event.getNativeEvent();
                if (nativeEvent.getEventTarget().cast() == topTabStop
                        && nativeEvent.getKeyCode() == KeyCodes.KEY_TAB
                        && nativeEvent.getShiftKey()) {
                    nativeEvent.preventDefault();
                }
                if (nativeEvent.getEventTarget().cast() == topTabStop
                        && nativeEvent.getKeyCode() == KeyCodes.KEY_BACKSPACE) {
                    nativeEvent.preventDefault();
                }
            }
        };

        bottomEventBlocker = new NativePreviewHandler() {
            @Override
            public void onPreviewNativeEvent(NativePreviewEvent event) {
                NativeEvent nativeEvent = event.getNativeEvent();
                if (nativeEvent.getEventTarget().cast() == bottomTabStop
                        && nativeEvent.getKeyCode() == KeyCodes.KEY_TAB
View Full Code Here

   * Activates all the hot keys registered.
   */
  public static void activateHotKeys() {
    timer.run();
    hotKeysHandlerRegistration = Event
        .addNativePreviewHandler(new NativePreviewHandler() {

          @Override
          public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (event.getTypeInt() == Event.ONKEYPRESS) {
              int keyCode = event.getNativeEvent().getKeyCode();
View Full Code Here

      new WidgetHandlerRegistration(this)
      {
         @Override
         protected HandlerRegistration doRegister()
         {
            return Event.addNativePreviewHandler(new NativePreviewHandler()
            {
               @Override
               public void onPreviewNativeEvent(NativePreviewEvent event)
               {
                  NativeEvent nativeEvent = event.getNativeEvent();
View Full Code Here

      installCustomToolbar();
     
      // subscribe to ESC key browser-wide for dismissal of the Locator UI
      // (unhook any existing subscription first)
      unhookNativePreviewHandler();
      escHandlerReg_ = Event.addNativePreviewHandler(new NativePreviewHandler(){

         public void onPreviewNativeEvent(NativePreviewEvent event)
         {
            if (event.getTypeInt() == Event.ONKEYDOWN
                && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE)
View Full Code Here

      new WidgetHandlerRegistration(this)
      {
         @Override
         protected HandlerRegistration doRegister()
         {
            return Event.addNativePreviewHandler(new NativePreviewHandler()
            {
               @Override
               public void onPreviewNativeEvent(NativePreviewEvent event)
               {
                  NativeEvent nativeEvent = event.getNativeEvent();
View Full Code Here

   @Override
   protected void onLoad()
   {
      super.onLoad();
      allTips_.add(this);
      nativePreviewReg_ = Event.addNativePreviewHandler(new NativePreviewHandler()
      {
         public void onPreviewNativeEvent(NativePreviewEvent e)
         {
            if (e.getTypeInt() == Event.ONKEYDOWN)
            {
View Full Code Here

        if (handleDragEvents
                && Event.as(startEvent).getTypeInt() == Event.ONMOUSEDOWN) {
            // only really start drag event on mousemove
            deferredStartRegistration = Event
                    .addNativePreviewHandler(new NativePreviewHandler() {

                        public void onPreviewNativeEvent(
                                NativePreviewEvent event) {
                            int typeInt = event.getTypeInt();
                            switch (typeInt) {
View Full Code Here

      el().center(true);
    }

    el().updateZIndex(0);
    if (modal) {
      modalPreview = Event.addNativePreviewHandler(new NativePreviewHandler() {
        public void onPreviewNativeEvent(NativePreviewEvent event) {
          if (Element.is(event.getNativeEvent().getEventTarget())) {
            Element target = (Element) Element.as(event.getNativeEvent().getEventTarget());

            String tag = target.getTagName();
View Full Code Here

      getElement().center(true);
    }

    getElement().updateZIndex(0);
    if (modal) {
      modalPreview = Event.addNativePreviewHandler(new NativePreviewHandler() {
        public void onPreviewNativeEvent(NativePreviewEvent event) {
          if (Element.is(event.getNativeEvent().getEventTarget())) {
            XElement target = event.getNativeEvent().getEventTarget().<XElement> cast();

            String tag = target.getTagName();
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.Event.NativePreviewHandler

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.