Java 类com.google.gwt.user.client.Event.NativePreviewEvent 实例源码

项目:vaadin-combobox-multiselect    文件:VComboBoxMultiselect.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    // Check all events outside the combobox to see if they scroll the
    // page. We cannot use e.g. Window.addScrollListener() because the
    // scrolled element can be at any level on the page.

    // Normally this is only called when the popup is showing, but make
    // sure we don't accidentally process all events when not showing.
    if (!this.scrollPending && isShowing()
            && !DOM.isOrHasChild(SuggestionPopup.this.getElement(), Element.as(event.getNativeEvent()
                .getEventTarget()))) {
        if (getDesiredLeftPosition() != this.leftPosition || getDesiredTopPosition() != this.topPosition) {
            updatePopupPositionOnScroll();
        }
    }

    super.onPreviewNativeEvent(event);
}
项目:LAS    文件:WindowBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (this.resizable) {
        // 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)
                && calcDragMode(nativeEvent.getClientX(),nativeEvent.getClientY()) >= 0) {
            nativeEvent.preventDefault();
        }
    }

    super.onPreviewNativeEvent(event);
}
项目:ephesoft    文件:ExternalAppDialogBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();

    if (evt.getCtrlKey()) {
        switch (evt.getKeyCode()) {
            case 'a':
            case 'A':
                evt.preventDefault();
                okButton.click();
            case 'z':
            case 'Z':
                evt.preventDefault();
                closeButton.click();
                break;
        }
    }

}
项目:ephesoft    文件:AboutDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown")) {
        // Use the popup's key preview hooks to close the dialog when either
        // enter or escape is pressed.
        switch (evt.getKeyCode()) {
        case KeyCodes.KEY_ENTER:
        case KeyCodes.KEY_ESCAPE:
            hide();
            break;
        default:
            break;
        }
    }
}
项目:ephesoft    文件:ExternalAppDialogBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();

    if (evt.getCtrlKey()) {
        switch (evt.getKeyCode()) {
            case 'a':
            case 'A':
                evt.preventDefault();
                okButton.click();
            case 'z':
            case 'Z':
                evt.preventDefault();
                closeButton.click();
                break;
            default:
            break;
        }
    }

}
项目:vaadin-combobox-multiselect    文件:VComboBoxMultiselect.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    // Check all events outside the combobox to see if they scroll the
    // page. We cannot use e.g. Window.addScrollListener() because the
    // scrolled element can be at any level on the page.

    // Normally this is only called when the popup is showing, but make
    // sure we don't accidentally process all events when not showing.
    if (!this.scrollPending && isShowing()
            && !DOM.isOrHasChild(SuggestionPopup.this.getElement(), Element.as(event.getNativeEvent()
                .getEventTarget()))) {
        if (getDesiredLeftPosition() != this.leftPosition || getDesiredTopPosition() != this.topPosition) {
            updatePopupPositionOnScroll();
        }
    }

    super.onPreviewNativeEvent(event);
}
项目:vaadin-sliderpanel    文件:VSliderPanel.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
    if (autoCollapseSlider && event != null && !event.isCanceled() && expand) {
        Event nativeEvent = Event.as(event.getNativeEvent());

        switch (nativeEvent.getTypeInt()) {
            case Event.ONMOUSEDOWN:
            case Event.ONTOUCHSTART:
            case Event.ONDBLCLICK:

                if (eventTargetsPopup(nativeEvent)) {
                    return;
                }
                if (eventTargetsInnerElementsPopover(nativeEvent)) {
                    return;
                }
                setExpand(false, true);
        }
    }
}
项目:fullmetalgalaxy    文件:AppRoot.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( p_event == null || p_event.getNativeEvent() == null
      || p_event.getNativeEvent().getEventTarget() == null )
  {
    return;
  }
  com.google.gwt.dom.client.Element elmt = com.google.gwt.dom.client.Element.as( p_event
      .getNativeEvent().getEventTarget() );
  if( elmt instanceof InputElement )
  {
    String type = ((InputElement)elmt).getType();
    if( type != null
        && (type.equals( "text" ) || type.equals( "password" ) || type.equals( "textarea" )) )
    {
      return;
    }
  }

  // don't preview event if user is editing someting in an input form
  m_previewListenerCollection.fireEventPreview( p_event );
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( p_event.getTypeInt() == Event.ONKEYDOWN )
  {
    // start scrolling ?
    onKeyDown( p_event.getNativeEvent().getKeyCode() );
    return;
  }
  if( p_event.getTypeInt() == Event.ONKEYUP )
  {
    // stop scrolling ?
    onKeyUp( p_event.getNativeEvent().getKeyCode() );
    return;
  }
  if( (p_event.getTypeInt() == Event.ONMOUSEUP) && (m_cancelMouseUpEvent) )
  {
    // cancel event
    return;
  }
}
项目:appformer    文件:ResizableMovableHeader.java   
@Override
public void onPreviewNativeEvent(final NativePreviewEvent event) {
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    final String eventType = nativeEvent.getType();
    if ("mousemove".equals(eventType)) {
        moveColumn(nativeEvent.getClientX());
    } else if ("mouseup".equals(eventType)) {
        handler.removeHandler();
        ghostColumn.removeFromParent();
        ghostLine.removeFromParent();
        if (fromIndex != toIndex) {
            columnMoved(fromIndex,
                        toIndex);
        }
        dragCallback.dragFinished();
    }
}
项目:appformer    文件:PanelManagerImpl.java   
@PostConstruct
private void setup() {
    globalHandlerRegistration = com.google.gwt.user.client.Event.addNativePreviewHandler(new NativePreviewHandler() {

        @Override
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (event.getTypeInt() == com.google.gwt.user.client.Event.ONKEYPRESS &&
                    event.getNativeEvent().getCharCode() == 'm' &&
                    event.getNativeEvent().getCtrlKey()) {
                if (maximizedPanel != null) {
                    maximizedPanel.unmaximize();
                    maximizedPanel = null;
                } else if (activePart != null) {
                    WorkbenchPanelPresenter activePanelPresenter = mapPanelDefinitionToPresenter.get(activePart.getParentPanel());
                    activePanelPresenter.maximize();
                    maximizedPanel = activePanelPresenter;
                }
            }
        }
    });
}
项目:mvp4g-examples    文件:AboutDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType()
         .equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
项目:avro-ui    文件:ResizePanel.java   
public ResizePanel(AvroUiStyle style) {
    super();
    DOM.sinkEvents(this.getElement(), Event.ONMOUSEDOWN | Event.ONMOUSEMOVE
            | Event.ONMOUSEUP | Event.ONMOUSEOVER);
    addStyleName(style.resizePanel());
    resizeElement = DOM.createDiv();
    resizeElement.addClassName(style.resizeHandle());
    this.getElement().appendChild(resizeElement);

    Event.addNativePreviewHandler(new NativePreviewHandler() {

        public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (resize) {
                int clientX = event.getNativeEvent().getClientX();
                int clientY = event.getNativeEvent().getClientY();
                int originalX = getElement().getAbsoluteLeft();
                int originalY = getElement().getAbsoluteTop();
                if (clientX < originalX || clientY < originalY) {
                    event.cancel();
                }
            }
        }

    });
}
项目:funWithGwt    文件:InforDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown")) {
        // Use the popup's key preview hooks to close the dialog when either
        // enter or escape is pressed.
        switch (evt.getKeyCode()) {
        case KeyCodes.KEY_ENTER:
        case KeyCodes.KEY_ESCAPE:
            hide();
            break;
        }
    }
}
项目:funWithGwt    文件:AboutDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown")) {
        // Use the popup's key preview hooks to close the dialog when either
        // enter or escape is pressed.
        switch (evt.getKeyCode()) {
        case KeyCodes.KEY_ENTER:
        case KeyCodes.KEY_ESCAPE:
            hide();
            break;
        }
    }
}
项目:funWithGwt    文件:InforDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType().equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
项目:geomajas-project-client-gwt2    文件:ZoomToRectangleControl.java   
private void startRectangle() {
    cleanup();
    container = mapPresenter.getContainerManager().addScreenContainer();
    zoomToRectangleGroup = new ZoomToRectGroup(mapPresenter.getViewPort());
    escapeHandler = Event.addNativePreviewHandler(new NativePreviewHandler() {

        public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (event.getTypeInt() == Event.ONKEYDOWN || event.getTypeInt() == Event.ONKEYPRESS) {
                if (KeyCodes.KEY_ESCAPE == event.getNativeEvent().getKeyCode()) {
                    cleanup();
                }
            }
        }
    });

    container.add(zoomToRectangleGroup);
}
项目:gwtutil    文件:BootstrapResultPopupPanel.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (event.getNativeEvent().getType().equals("keydown") && event.isFirstHandler()) {
        switch (event.getNativeEvent().getKeyCode()) {
        case KeyCodes.KEY_ESCAPE:
            if (!(getFocusedWidget() instanceof PreventsKeyboardClose)) {
                event.consume();
                closeCancel();
            }
            break;
        case KeyCodes.KEY_ENTER:
            // typeahead box hides this panel automatically if possible
            if (!(getFocusedWidget() instanceof PreventsKeyboardClose)) {
                event.consume();
                closeOk();
            }
            break;
        }
    }
}
项目:gwtutil    文件:ResizableHeader.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
    final NativeEvent natEvent = event.getNativeEvent();
    final Element element = natEvent.getEventTarget().cast();
    final String eventType = natEvent.getType();
    if (!(element == left || element == right)) {
        if ("mousedown".equals(eventType)) {
            //No need to do anything, the event will be passed on to the column sort handler
        } else if (!dragging && "mouseover".equals(eventType)) {
            cleanUp();
        }
        return;
    }
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    if ("mousedown".equals(eventType)) {
        if (element == right) {
            left.removeFromParent();
            new ColumnResizeHelper(this, source, right, nativeEvent);
        } else
            new ColumnMoverHelper(this, source, nativeEvent);
        dragging = true;
    }
}
项目:vaadin-overlays    文件:CustomOverlayWidget.java   
/**
 * The constructor should first call super() to initialize the component and
 * then handle any initialization relevant to Vaadin.
 */
public CustomOverlayWidget() {
    setWidget(new HTML()); // Seems that we need this one
    overlay = new PopupPanel();
    overlay.addStyleName(CLASSNAME);
    overlay.setAutoHideEnabled(false);
    overlay.setAnimationEnabled(false);
    overlay.setModal(false);

    Event.addNativePreviewHandler(new NativePreviewHandler() {
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            int typeInt = event.getTypeInt();
            // We're only listening for these
            if (typeInt == Event.ONSCROLL) {
                CustomOverlayWidget.this.updateOverlayPosition();
            }
        }
    });
}
项目:Peergos    文件:AboutDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType().equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
项目:swarm    文件:AboutDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType().equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
项目:touchkit    文件:PopoverConnector.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
    EventTarget target = event.getNativeEvent().getEventTarget();
    Element targetElement = null;
    if (Element.is(target)) {
        targetElement = Element.as(target);
    }

    if (getWidget().getModalityCurtain().isOrHasChild(targetElement)
            && getWidget().isClosable()
            && (event.getTypeInt() & ACCEPTEDEVENTS) == 0) {
        /*
         * Close on events outside window. Special handling for mousemove
         * etc to aid compatibility with desktop (testing purposes).
         */
        rpc.close();
    }
}
项目:unitimes    文件:UniTimeDialogBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    super.onPreviewNativeEvent(event);
    if (isEscapeToHide() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
        AriaStatus.getInstance().setText(ARIA.dialogClosed(getText()));
        hide();
    } if (isEnterToSubmit() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
        event.getNativeEvent().stopPropagation();
        event.getNativeEvent().preventDefault();
        iSubmitHandler.execute();
    }
}
项目:document-management-system    文件:ExtendedPopupPanel.java   
/**
 * ExtendedPopupPanel
 */
public ExtendedPopupPanel(boolean autoHide, boolean modal) {
    super(autoHide, modal);

    // Ensures when mouseup / onclick / ondblclick event is disabled drag flag and not consumed by popup
    Event.addNativePreviewHandler(new NativePreviewHandler() {
        @Override
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            int type = event.getTypeInt();
            if (type == Event.ONMOUSEUP || type == Event.ONCLICK || type == Event.ONDBLCLICK) {
                Main.get().activeFolderTree.disableDragged();
            }
        }
    });
}
项目:ephesoft    文件:ConfirmationDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals(KEYDOWN) && evt.getKeyCode() == KeyCodes.KEY_ESCAPE && performCancelOnEscape && listener != null
            && cancelButton.isVisible()) {
        listener.onCancelClick();
        hide();
    }

}
项目:ephesoft    文件:RadioButtonDialogView.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ESCAPE) {
        // Use the popup's key preview hooks to close the dialog when either
        // enter or escape is pressed.
        hide();
    }
}
项目:ephesoft    文件:PageMoveDialog.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ESCAPE) {
        // Use the popup's key preview hooks to close the dialog when either
        // enter or escape is pressed.
        hide();
    }
}
项目:ephesoft    文件:DisplayDialogBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
    super.onPreviewNativeEvent(preview);

    NativeEvent evt = preview.getNativeEvent();
    if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ESCAPE) {
        hide();
    }
}
项目:teiid-webui    文件:NotificationWidget.java   
/**
 * Processes a native event so that we can track mouse movements in and
 * out of this widget.
 * @param event
 */
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (event.getTypeInt() == Event.ONMOUSEMOVE) {
        int x = event.getNativeEvent().getClientX();
        int y = event.getNativeEvent().getClientY();
        handleMouseMove(x, y);
    }
}
项目:hawkbit    文件:ViewClientCriterion.java   
@Override
// Exception squid:S1604 - GWT 2.7 does not support Java 8
@SuppressWarnings("squid:S1604")
public void accept(final VDragEvent drag, final UIDL configuration, final VAcceptCallback callback) {

    if (isDragStarting(drag)) {
        final NativePreviewHandler nativeEventHandler = new NativePreviewHandler() {
            @Override
            public void onPreviewNativeEvent(NativePreviewEvent event) {
                if (isEscKey(event) || isMouseUp(event)) {
                    try {
                        hideDropTargetHints(configuration);
                    } finally {
                        nativeEventHandlerRegistration.removeHandler();
                    }
                }
            }
        };

        nativeEventHandlerRegistration = Event.addNativePreviewHandler(nativeEventHandler);
        setMultiRowDragDecoration(drag);
    }

    int childCount = configuration.getChildCount();
    accepted = false;
    for (int childIndex = 0; childIndex < childCount; childIndex++) {
        VAcceptCriterion crit = getCriteria(configuration, childIndex);
        crit.accept(drag, configuration.getChildUIDL(childIndex), this);
        if (Boolean.TRUE.equals(accepted)) {
            callback.accepted(drag);
            return;
        }
    }

    // if no VAcceptCriterion accepts and the mouse is release, an error
    // message is shown
    if (Event.ONMOUSEUP == Event.getTypeInt(drag.getCurrentGwtEvent().getType())) {
        showErrorNotification(drag);
    }
}
项目:hawkbit    文件:ViewClientCriterion.java   
/**
 * Checks if the origin of the given event is a pressed ESC key.
 *
 * @param event
 *            the event to analyze
 * @return <code>true</code> if the origin of the event is a pressed ESC
 *         key, otherwise <code>false</code>.
 */
private static boolean isEscKey(final NativePreviewEvent event) {
    int typeInt = event.getTypeInt();
    if (typeInt == Event.ONKEYDOWN) {
        int keyCode = event.getNativeEvent().getKeyCode();
        if (KeyCodes.KEY_ESCAPE == keyCode) {
            return true;
        }
    }
    return false;
}
项目:context-menu    文件:ContextMenuConnector.java   
@Override
protected void init() {
    super.init();

    dummyRootMenuBar = GWT.create(MyVMenuBar.class);

    CustomMenuItem item = GWT.create(CustomMenuItem.class);
    dummyRootMenuBar.getItems().add(item);

    contextMenuWidget = new MyVMenuBar(true, dummyRootMenuBar);
    item.setSubMenu(contextMenuWidget);

    // application connection that is used for all our overlays
    MyVOverlay.setApplicationConnection(this.getConnection());

    registerRpc(ContextMenuClientRpc.class, new ContextMenuClientRpc() {
        @Override
        public void showContextMenu(int x, int y) {
            showMenu(x, y);
        }
    });

    Event.addNativePreviewHandler(new NativePreviewHandler() {
        @Override
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (event.getTypeInt() == Event.ONKEYDOWN
                    && contextMenuWidget.isPopupShowing()) {
                boolean handled = contextMenuWidget.handleNavigation(
                        event.getNativeEvent().getKeyCode(),
                        event.getNativeEvent().getCtrlKey(),
                        event.getNativeEvent().getShiftKey());

                if (handled) {
                    event.cancel();
                }
            }
        }
    });
}
项目:umlet    文件:MyPopupPanel.java   
/**
 * pressing ESC closes the dialogbox
 */
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    super.onPreviewNativeEvent(event);
    if (event.getTypeInt() == Event.ONKEYDOWN &&
        event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
        hide();
    }
}
项目:umlet    文件:ShortcutDialogBox.java   
/**
 * pressing ESC closes the dialogbox
 */
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    super.onPreviewNativeEvent(event);
    if (event.getTypeInt() == Event.ONKEYDOWN &&
        event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
        hide();
    }
}
项目:umlet    文件:SaveDialogBox.java   
/**
 * pressing ESC closes the dialogbox
 */
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    super.onPreviewNativeEvent(event);
    if (event.getTypeInt() == Event.ONKEYDOWN &&
        event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
        hide();
    }
}
项目:unitime    文件:UniTimeDialogBox.java   
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    super.onPreviewNativeEvent(event);
    if (isEscapeToHide() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
        AriaStatus.getInstance().setText(ARIA.dialogClosed(getText()));
        hide();
    } if (isEnterToSubmit() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
        event.getNativeEvent().stopPropagation();
        event.getNativeEvent().preventDefault();
        iSubmitHandler.execute();
    }
}
项目:fullmetalgalaxy    文件:MAppTabMenu.java   
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( (p_event.getTypeInt() == Event.ONKEYPRESS) && (p_event.getNativeEvent().getCtrlKey()) )
  {
    if( p_event.getNativeEvent().getKeyCode() == 'm'
        || p_event.getNativeEvent().getKeyCode() == 'M' )
    {
      // cancel event
      return;
    }
  }
}
项目:appformer    文件:ResizableMovableHeader.java   
@Override
public void onPreviewNativeEvent(final NativePreviewEvent event) {
    final NativeEvent natEvent = event.getNativeEvent();
    final Element element = natEvent.getEventTarget().cast();
    final String eventType = natEvent.getType();
    if (!(element == moveHandle || element == resizeHandle)) {
        if ("mousedown".equals(eventType)) {
            //No need to do anything, the event will be passed on to the column sort handler
        } else if (!dragging && "mouseover".equals(eventType)) {
            cleanUp();
        }
        return;
    }
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    if ("mousedown".equals(eventType)) {
        if (element == resizeHandle) {
            moveHandle.removeFromParent();
            new ColumnResizeHelper(this,
                                   source,
                                   nativeEvent);
        } else {
            new ColumnMoverHelper(this,
                                  source,
                                  nativeEvent);
        }
        dragging = true;
    }
}
项目:appformer    文件:ResizableMovableHeader.java   
@Override
public void onPreviewNativeEvent(final NativePreviewEvent event) {
    final NativeEvent nativeEvent = getEventAndPreventPropagation(event);
    final int clientX = nativeEvent.getClientX();
    final String eventType = nativeEvent.getType();
    if ("mousemove".equals(eventType)) {
        moveLine(clientX);
    } else if ("mouseup".equals(eventType)) {
        handler.removeHandler();
        resizeLine.removeFromParent();
        dragCallback.dragFinished();
        columnResized(Math.max(clientX - header.getAbsoluteLeft(),
                               MINIMUM_COLUMN_WIDTH));
    }
}