Examples of XEvent


Examples of com.sencha.gxt.widget.core.client.event.XEvent

    if (fireSelectionChangeOnClick) {
      fireSelectionChange();
      fireSelectionChangeOnClick = false;
    }

    XEvent xe = event.getEvent().<XEvent> cast();

    int rowIndex = event.getRowIndex();
    int colIndex = event.getColumnIndex();
    if (rowIndex == -1) {
      deselectAll();
      return;
    }

    M sel = listStore.get(rowIndex);

    boolean isSelected = isSelected(sel);
    boolean isControl = xe.getCtrlOrMetaKey();
    boolean isShift = xe.getShiftKey();

    // we only handle multi select with control key here
    if (selectionMode == SelectionMode.MULTI) {
      if (isSelected && isControl) {
        grid.getView().focusCell(rowIndex, colIndex, false);
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

    }

    focusCellCalled = false;
    mouseDown = true;

    XEvent e = event.getEvent().<XEvent> cast();

    // it is important the focusCell be called once, and only once in onRowMouseDown and onRowClick
    // everything but multi select with the control key pressed is handled in mouse down

    if (event.getEvent().getButton() == Event.BUTTON_RIGHT) {
      if (selectionMode != SelectionMode.SINGLE && isSelected(listStore.get(rowIndex))) {
        return;
      }
      grid.getView().focusCell(rowIndex, colIndex, false);
      select(rowIndex, false);
      focusCellCalled = true;
    } else {
      M sel = listStore.get(rowIndex);
      if (sel == null) { // EXTGWT-2692
        return;
      }
      boolean isSelected = isSelected(sel);
      boolean isControl = e.getCtrlOrMetaKey();
      boolean isShift = event.getEvent().getShiftKey();

      switch (selectionMode) {
        case SIMPLE:
          grid.getView().focusCell(rowIndex, colIndex, false);
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

   * Handles a key down event (e.g. as fired by the key navigator).
   *
   * @param ne the key down event
   */
  protected void onKeyDown(NativeEvent ne) {
    XEvent e = ne.<XEvent> cast();
    if (Element.is(ne.getEventTarget()) && !grid.getView().isSelectableTarget(Element.as(ne.getEventTarget()))) {
      return;
    }
    if (listStore.size() == 0) {
      return;
    }
    if (!e.getCtrlOrMetaKey() && selected.size() == 0 && getLastFocused() == null) {
      select(0, false);
    } else {
      int idx = listStore.indexOf(getLastFocused());
      if (idx >= 0 && (idx + 1) < listStore.size()) {
        if (e.getCtrlOrMetaKey() || (e.getShiftKey() && isSelected(listStore.get(idx + 1)))) {
          if (!e.getCtrlOrMetaKey()) {
            deselect(idx);
          }

          M lF = listStore.get(idx + 1);
          if (lF != null) {
            setLastFocused(lF);
            grid.getView().focusCell(idx + 1, 0, false);
          }

        } else {
          if (e.getShiftKey() && lastSelected != getLastFocused()) {
            grid.getView().focusCell(idx + 1, 0, false);
            select(listStore.indexOf(lastSelected), idx + 1, true);
          } else {
            if (idx + 1 < listStore.size()) {
              grid.getView().focusCell(idx + 1, 0, false);
              selectNext(e.getShiftKey());
            }
          }
        }
      } else {
        grid.getView().onNoNext(idx);
      }
    }

    e.preventDefault();
  }
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

      return;
    }

    int kc = ne.getKeyCode();

    XEvent e = ne.<XEvent> cast();

    if (lastSelected != null && enableNavKeys) {
      if (kc == KeyCodes.KEY_PAGEUP) {
        e.stopPropagation();
        e.preventDefault();
        select(0, false);
        grid.getView().focusRow(0);
      } else if (kc == KeyCodes.KEY_PAGEDOWN) {
        e.stopPropagation();
        e.preventDefault();
        int idx = listStore.indexOf(listStore.get(listStore.size() - 1));
        select(idx, false);
        grid.getView().focusRow(idx);
      }
    }
    // if space bar is pressed
    if (e.getKeyCode() == 32) {
      if (getLastFocused() != null) {
        if (e.getShiftKey() && lastSelected != null) {
          int last = listStore.indexOf(lastSelected);
          int i = listStore.indexOf(getLastFocused());
          grid.getView().focusCell(i, 0, false);
          select(last, i, e.getCtrlOrMetaKey());
        } else {
          if (isSelected(getLastFocused())) {
            deselect(getLastFocused());
          } else {
            grid.getView().focusCell(listStore.indexOf(getLastFocused()), 0, false);
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

   * Handles a key up event (e.g. as fired by the key navigator).
   *
   * @param e the key up event
   */
  protected void onKeyUp(NativeEvent e) {
    XEvent xe = e.<XEvent> cast();
    if (Element.is(e.getEventTarget()) && !grid.getView().isSelectableTarget(Element.as(e.getEventTarget()))) {
      return;
    }
    int idx = listStore.indexOf(getLastFocused());
    if (idx >= 1) {
      if (xe.getCtrlOrMetaKey() || (e.getShiftKey() && isSelected(listStore.get(idx - 1)))) {
        if (!xe.getCtrlOrMetaKey()) {
          deselect(idx);
        }

        M lF = listStore.get(idx - 1);
        if (lF != null) {
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

      }
    }
  }

  protected void handleMouseDown(CellMouseDownEvent event) {
    XEvent e = event.getEvent().<XEvent> cast();
    if (e.getButton() != Event.BUTTON_LEFT || isLocked()) {
      return;
    }
    if (selection != null && selection.getRow() == event.getRowIndex() && selection.getCell() == event.getCellIndex()
        && e.getCtrlOrMetaKey()) {
      deselectAll();
      return;
    }
    selectCell(event.getRowIndex(), event.getCellIndex());
  }
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

  protected void onClear(StoreClearEvent<M> event) {
    clear();
  }

  protected void onClick(Event event) {
    XEvent e = event.<XEvent> cast();
    TreeNode<M> node = findNode(event.getEventTarget().<Element> cast());
    if (node != null) {
      Element jointEl = view.getJointElement(node);
      if (jointEl != null && e.within(jointEl)) {
        toggle((M) node.getModel());
      }
      Element checkEl = view.getCheckElement(node);
      if (checkable && checkEl != null && isEnabled() && e.within(checkEl)) {
        onCheckClick(event, node);
      }
    }

    focusEl.setXY(event.getClientX(), event.getClientY());
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

  }

  @Override
  protected void onTargetMouseOut(MouseOutEvent event) {
    if (showElem != null) {
      XEvent xe = event.getNativeEvent().cast();
      if (!xe.within(showElem)) {
        clearTimer("show");
      }
    }
    onTargetOut(event.getNativeEvent().<Event> cast());
  }
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

      }
    }
    clearTimers();
    targetXY = ce.<XEvent> cast().getXY();

    XEvent xe = ce.cast();
    if (!xe.within(t)) {
      return;
    }

    showElem = t;
    delayShow();
View Full Code Here

Examples of com.sencha.gxt.widget.core.client.event.XEvent

      setValue(activeDate.getFirstDayOfMonth().asDate(), false);
    }
  }

  protected void onKeyLeft(NativeEvent evt) {
    XEvent e = evt.cast();
    e.stopEvent();
    if (e.getCtrlOrMetaKey()) {
      showPrevMonth();
    } else {
      setValue(activeDate.addDays(-1).asDate(), false);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.