@Override
  public void onTab(Component component, PreviewEvent pe) {
    if (!isManaged()) return;

    if (!pe.isShiftKey() && forwardIfOverride(component)) {
      pe.stopEvent();
      return;
    } else if (pe.isShiftKey() && previousIfOverride(component)) {
      pe.stopEvent();
      return;
    }
  }
Exemple #2
0
 @Override
 public void onEnter(Component component, PreviewEvent pe) {
   if (!isManaged()) return;
   if (component instanceof HeaderItem) {
     pe.preventDefault();
     TabItem item = (TabItem) component.getParent();
     stepInto(item, pe, true);
   } else if (component instanceof TabPanel) {
     pe.preventDefault();
     TabPanel panel = (TabPanel) component;
     TabItem item = panel.getSelectedItem();
     if (item != null && item.getItemCount() > 0) {
       item.getItem(0).focus();
     }
   }
 }
Exemple #3
0
 protected void onEscape(PreviewEvent pe) {
   if (pe.getKeyCode() == KeyCodes.KEY_ESCAPE) {
     if (activeItem != null && !activeItem.onEscape()) {
       return;
     }
     hide(false);
   }
 }
Exemple #4
0
  @Override
  public void onTab(Component component, PreviewEvent pe) {
    if (!isManaged()) return;
    if (component instanceof TabItem) {
      pe.preventDefault();

      if (pe.isShiftKey()) {
        focusPreviousWidget(component.getParent());
      } else {
        focusNextWidget(component.getParent());
      }
    } else if (component instanceof HeaderItem) {
      pe.preventDefault();
      if (pe.isShiftKey()) {
        focusPreviousWidget(component);
      } else {
        focusNextWidget(component);
      }
    }
  }
Exemple #5
0
 public void onEscape(Component component, PreviewEvent pe) {
   if (!isManaged()) return;
   Widget p = component.getParent();
   if (p != null) {
     pe.stopEvent();
     if (p instanceof TabItem) {
       stepOut(((TabItem) p).getTabPanel());
     } else {
       stepOut(component);
     }
   }
 }
Exemple #6
0
 protected boolean onAutoHide(PreviewEvent pe) {
   if ((pe.getEventTypeInt() == Event.ONMOUSEDOWN
           || pe.getEventTypeInt() == Event.ONMOUSEWHEEL
           || pe.getEventTypeInt() == Event.ONSCROLL
           || pe.getEventTypeInt() == Event.ONKEYPRESS)
       && !(pe.within(getElement())
           || (fly(pe.getTarget()).findParent(".x-ignore", -1) != null))) {
     MenuEvent me = new MenuEvent(this);
     me.setEvent(pe.getEvent());
     if (fireEvent(Events.AutoHide, me)) {
       hide(true);
       return true;
     }
   }
   return false;
 }