@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); } }
@Override public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); switch (ce.getEventTypeInt()) { case Event.ONCLICK: onClick(ce); break; case Event.ONMOUSEMOVE: onMouseMove(ce); break; case Event.ONMOUSEOUT: onMouseOut(ce); break; case Event.ONMOUSEOVER: onMouseOver(ce); break; case Event.ONMOUSEWHEEL: if (enableScrolling) { scrollMenu(ce.getEvent().getMouseWheelVelocityY() < 0); } } El t = ce.getTargetEl(); if (enableScrolling && t.is(".x-menu-scroller")) { switch (ce.getEventTypeInt()) { case Event.ONMOUSEOVER: // deactiveActiveItem(); onScrollerIn(t); break; case Event.ONMOUSEOUT: onScrollerOut(t); break; } } }
protected void onClick(ComponentEvent ce) { ce.preventDefault(); if (!disabled) { El aElement = ce.getTarget("a", 3); String className = aElement.getStyleName(); if (className.indexOf("color-") != -1) { select( className.substring(className.indexOf("color-") + 6, className.indexOf("color-") + 12)); } } }
@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 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); } } } }
@Override public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); if (ce.getEventTypeInt() == Event.ONCLICK) { onClick(ce); } }
protected void onClick(ComponentEvent ce) { if (cancelBubble) { ce.cancelBubble(); } removeStyleName(style + "-over"); fireEvent(Events.Select, ce); }
protected void onClick(ComponentEvent ce) { if (checkboxToggle && ce.getTarget() == (Element) checkbox.cast()) { setExpanded(!isExpanded()); boolean isExpanded = isExpanded(); checkbox.setChecked(isExpanded); checkbox.setDefaultChecked(isExpanded); } }
/** {@inheritDoc} */ @Override public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); switch (ce.getEventTypeInt()) { case Event.ONCHANGE: onChange(); break; } }
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); } } }
protected void onMouseOut(ComponentEvent ce) { EventTarget to = ce.getEvent().getRelatedEventTarget(); if (activeItem != null && (to == null || (Element.is(to) && !DOM.isOrHasChild(activeItem.getElement(), (Element) Element.as(to)))) && activeItem.shouldDeactivate(ce)) { deactiveActiveItem(); } }
/** {@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 public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); if (ce.getEventTypeInt() == Event.ONMOUSEDOWN) { // dont bring to front on clicks where active is model as active window // may have just been opened from this click event Window active = manager.getActive(); if (active != null && active != this && !active.isModal()) { manager.bringToFront(this); } } }
protected void onClick(ComponentEvent ce) { ce.preventDefault(); focus(); hideToolTip(); if (!disabled) { ButtonEvent be = new ButtonEvent(this); if (!fireEvent(Events.BeforeSelect, be)) { return; } if (menu != null && !menu.isVisible()) { showMenu(); } fireEvent(Events.Select, be); } }
@Override public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); switch (ce.getEventTypeInt()) { case Event.ONCLICK: onClick(ce); break; case Event.ONMOUSEOVER: onMouseOver(ce); break; case Event.ONMOUSEOUT: onMouseOut(ce); break; } }
private void itemSelected(ComponentEvent ce) { Window w; if (ce instanceof MenuEvent) { MenuEvent me = (MenuEvent) ce; w = me.getItem().getData("window"); } else { w = ce.getComponent().getData("window"); } if (!desktop.getWindows().contains(w)) { desktop.addWindow(w); } if (w != null && !w.isVisible()) { w.show(); } else { w.toFront(); } }
public void onComponentEvent(ComponentEvent ce) { switch (ce.getEventTypeInt()) { case Event.ONMOUSEOVER: addStyleName(style + "-over"); break; case Event.ONMOUSEOUT: removeStyleName(style + "-over"); break; case Event.ONCLICK: onClick(ce); break; case Event.ONFOCUS: onFocus(ce); break; case Event.ONBLUR: onBlur(ce); break; case Event.ONKEYUP: onKeyPress(ce); break; } }
protected void onKeyUp(ComponentEvent e) { selectPrevious(e.isShiftKey()); e.preventDefault(); }
protected void onKeyDown(ComponentEvent e) { selectNext(e.isShiftKey()); e.preventDefault(); }
protected void onKeyPress(ComponentEvent ce) { int code = ce.getKeyCode(); if (code == KeyCodes.KEY_ENTER || code == 32) { onClick(ce); } }
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); } }
protected void onClick(ComponentEvent ce) { Component item = findItem(ce.getTarget()); if (item != null && item instanceof Item) { ((Item) item).onClick(ce); } }
protected void onMouseOver(ComponentEvent ce) { El target = ce.getTarget("a", 3); if (target != null) { target.addStyleName("x-color-palette-hover"); } }