예제 #1
0
파일: Menu.java 프로젝트: mxro/osgi-maven
  /**
   * 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);
      }
    }
  }
예제 #2
0
파일: Menu.java 프로젝트: mxro/osgi-maven
 protected void deactiveActiveItem() {
   if (activeItem != null) {
     activeItem.deactivate();
     activeItem = null;
   }
   if (GXT.isFocusManagerEnabled()) {
     FocusFrame.get().unframe();
     Accessibility.setState(getElement(), "aria-activedescendant", "");
   }
 }
예제 #3
0
 protected void onFocus(ComponentEvent ce) {
   if (GXT.isFocusManagerEnabled() && !GXT.isIE) {
     FocusFrame.get().frame(this);
   }
 }
예제 #4
0
 protected void onBlur(ComponentEvent ce) {
   if (GXT.isFocusManagerEnabled()) {
     FocusFrame.get().unframe();
   }
 }