Example #1
0
 protected void onMouseMove(ComponentEvent ce) {
   Component c = findItem(ce.getTarget());
   if (c != null && c instanceof Item) {
     Item item = (Item) c;
     if (activeItem != item && item.canActivate && item.isEnabled()) {
       setActiveItem(item, true);
     }
   }
 }
Example #2
0
 protected Item tryActivate(int start, int step) {
   for (int i = start, len = getItemCount(); i >= 0 && i < len; i += step) {
     Component c = getItem(i);
     if (c instanceof Item) {
       Item item = (Item) c;
       if (item.canActivate && item.isEnabled()) {
         setActiveItem(item, false);
         return item;
       }
     }
   }
   return null;
 }
Example #3
0
 protected void onMouseOver(ComponentEvent ce) {
   EventTarget from = ce.getEvent().getRelatedEventTarget();
   if (from == null
       || (Element.is(from) && !DOM.isOrHasChild(getElement(), (Element) Element.as(from)))) {
     Component c = findItem(ce.getTarget());
     if (c != null && c instanceof Item) {
       Item item = (Item) c;
       if (activeItem != item && item.canActivate && item.isEnabled()) {
         setActiveItem(item, true);
       }
     }
   }
 }