Пример #1
0
 @Override
 public int getAccessibleIndexInParent() {
   toolkit.lockAWT();
   try {
     Accessible aParent = getAccessibleParent();
     int aIndex = -1;
     if (aParent instanceof MenuComponent) {
       MenuComponent parent = (MenuComponent) aParent;
       int count = parent.getItemCount();
       for (int i = 0; i < count; i++) {
         MenuComponent comp = parent.getItem(i);
         if (comp instanceof Accessible) {
           aIndex++;
           if (comp == MenuComponent.this) {
             return aIndex;
           }
         }
       }
     }
     return -1;
   } finally {
     toolkit.unlockAWT();
   }
 }
Пример #2
0
 void hide() {
   selectedItemIndex = -1;
   if (parent instanceof MenuComponent) {
     ((MenuComponent) parent).itemHidden(this);
   }
 }