/** * Sets the active item. The component must be of type <code>Item</code> to be activated. All * other types are ignored. * * @param c the component to set active * @param autoExpand true to auto expand the item */ public void setActiveItem(Component c, boolean autoExpand) { if (c == null) { deactiveActiveItem(); return; } if (c instanceof Item) { Item item = (Item) c; if (item != activeItem) { deactiveActiveItem(); this.activeItem = item; item.activate(autoExpand); item.el().scrollIntoView(ul.dom, false); focus(); if (GXT.isFocusManagerEnabled()) { FocusFrame.get().frame(item); Accessibility.setState(getElement(), "aria-activedescendant", item.getId()); } } else if (autoExpand) { item.expandMenu(autoExpand); } } }
protected void deactiveActiveItem() { if (activeItem != null) { activeItem.deactivate(); activeItem = null; } if (GXT.isFocusManagerEnabled()) { FocusFrame.get().unframe(); Accessibility.setState(getElement(), "aria-activedescendant", ""); } }
protected void onFocus(ComponentEvent ce) { if (GXT.isFocusManagerEnabled() && !GXT.isIE) { FocusFrame.get().frame(this); } }
protected void onBlur(ComponentEvent ce) { if (GXT.isFocusManagerEnabled()) { FocusFrame.get().unframe(); } }