protected void onScrollerIn(El t) { boolean top = t.is(".x-menu-scroller-top"); if (top ? ul.getScrollTop() > 0 : ul.getScrollTop() + activeMax < ul.dom.getPropertyInt("scrollHeight")) { t.addStyleName("x-menu-item-active", "x-menu-scroller-active"); } }
@SuppressWarnings("rawtypes") @Override public void handleComponentEvent(GridEvent ge) { super.handleComponentEvent(ge); int type = ge.getEventTypeInt(); Element target = ge.getTarget(); if (!ignoreScroll && (type == Event.ONSCROLL && liveScroller.dom.isOrHasChild(target)) || (type == Event.ONMOUSEWHEEL && mainBody.dom.isOrHasChild(target))) { ge.stopEvent(); if (type == Event.ONMOUSEWHEEL) { int v = ge.getEvent().getMouseWheelVelocityY() * getCalculatedRowHeight(); liveScroller.setScrollTop(liveScroller.getScrollTop() + v); } else { updateRows( (int) Math.ceil((double) liveScroller.getScrollTop() / getCalculatedRowHeight()), false); } } }
protected void onScroll(ClickRepeaterEvent ce) { El target = ce.getEl(); boolean top = target.is(".x-menu-scroller-top"); scrollMenu(top); if (top ? ul.getScrollTop() <= 0 : ul.getScrollTop() + activeMax >= ul.dom.getPropertyInt("scrollHeight")) { onScrollerOut(target); } }
protected void scrollMenu(boolean top) { ul.setScrollTop(ul.getScrollTop() + scrollIncrement * (top ? -1 : 1)); }
@Override protected void notifyShow() { super.notifyShow(); updateRows( (int) Math.ceil((double) liveScroller.getScrollTop() / getCalculatedRowHeight()), true); }