예제 #1
0
 @Override
 public void onBrowserEvent(Event event) {
   if (cancelled) {
     return;
   }
   super.onBrowserEvent(event);
   assertMouseCoordinates(event);
   assertEquals(Event.BUTTON_LEFT, event.getButton());
 }
예제 #2
0
 @Override
 public void onBrowserEvent(Event event) {
   switch (DOM.eventGetType(event)) {
     case Event.ONCLICK:
       {
         // tabs can be closed by (a) middle mouse (anywhere), or (b)
         // left click on close element
         if (event.getButton() == Event.BUTTON_MIDDLE
             || (Element.as(event.getEventTarget()) == closeElement_
                 && event.getButton() == Event.BUTTON_LEFT)) {
           closeHandler_.onTabClose();
           event.stopPropagation();
           event.preventDefault();
         }
         break;
       }
   }
   super.onBrowserEvent(event);
 }