@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); } }
/** {@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(); }
@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); } }); }
protected void onKeyUp(ComponentEvent ce) { ce.stopEvent(); if (tryActivate(indexOf(activeItem) - 1, -1) == null) { tryActivate(getItemCount() - 1, -1); } }
protected void onKeyDown(ComponentEvent ce) { ce.stopEvent(); if (tryActivate(indexOf(activeItem) + 1, 1) == null) { tryActivate(0, 1); } }