@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();
}
}
}