Ejemplo n.º 1
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();
     }
   }
 }
Ejemplo n.º 2
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);
      }
    }
  }