Esempio n. 1
0
 @Override
 public void onComponentEvent(ComponentEvent ce) {
   super.onComponentEvent(ce);
   ButtonEvent be = (ButtonEvent) ce;
   switch (ce.getEventTypeInt()) {
     case Event.ONMOUSEOVER:
       onMouseOver(ce);
       break;
     case Event.ONMOUSEOUT:
       onMouseOut(ce);
       break;
     case Event.ONMOUSEDOWN:
       ce.stopEvent();
       onMouseDown(ce);
       break;
     case Event.ONMOUSEUP:
       ce.stopEvent();
       onMouseUp(ce);
       break;
     case Event.ONCLICK:
       ce.stopEvent();
       onClick(ce);
       break;
     case Event.ONFOCUS:
       onFocus(ce);
       break;
     case Event.ONBLUR:
       onBlur(be);
   }
 }
Esempio n. 2
0
 /** {@inheritDoc} */
 @Override
 protected void onBlur(ComponentEvent ce) {
   final Rectangle rec = button.el().getBounds();
   if (rec.contains(BaseEventPreview.getLastXY())) {
     ce.stopEvent();
     return;
   }
   super.onBlur(ce);
   focusPreview.remove();
 }
Esempio n. 3
0
 @Override
 protected void onRightClick(ComponentEvent ce) {
   ce.stopEvent();
   final int x = ce.getClientX();
   final int y = ce.getClientY();
   DeferredCommand.addCommand(
       new Command() {
         public void execute() {
           tabPanel.onItemContextMenu(TabItem.this, x, y);
         }
       });
 }
Esempio n. 4
0
 protected void onKeyUp(ComponentEvent ce) {
   ce.stopEvent();
   if (tryActivate(indexOf(activeItem) - 1, -1) == null) {
     tryActivate(getItemCount() - 1, -1);
   }
 }
Esempio n. 5
0
 protected void onKeyDown(ComponentEvent ce) {
   ce.stopEvent();
   if (tryActivate(indexOf(activeItem) + 1, 1) == null) {
     tryActivate(0, 1);
   }
 }