Ejemplo n.º 1
0
  @Override
  public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);

    final MenuItem item = findItem(DOM.eventGetTarget(event));
    switch (DOM.eventGetType(event)) {
      case Event.ONCLICK:
        {
          // Fire an item's command when the user clicks on it.
          if (item != null) {
            doItemAction(item, true);
          }
          break;
        }

      case Event.ONMOUSEOVER:
        {
          if (item != null) {
            itemOver(item);
          }
          break;
        }

      case Event.ONMOUSEOUT:
        {
          if (item != null) {
            itemOver(null);
          }
          break;
        }
    }
  }
Ejemplo n.º 2
0
 private static void dispatchEventInternal(Widget target, Event event) {
   if (CheckBox.class.isInstance(target) && event.getTypeInt() == Event.ONCLICK) {
     CheckBox checkBox = (CheckBox) target;
     if (RadioButton.class.isInstance(target)) {
       checkBox.setValue(true);
     } else {
       checkBox.setValue(!checkBox.getValue());
     }
   }
   target.onBrowserEvent(event);
 }