예제 #1
0
파일: Menu.java 프로젝트: mxro/osgi-maven
 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");
   }
 }
예제 #2
0
 @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);
     }
   }
 }
예제 #3
0
파일: Menu.java 프로젝트: mxro/osgi-maven
  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);
    }
  }
예제 #4
0
파일: Menu.java 프로젝트: mxro/osgi-maven
 protected void scrollMenu(boolean top) {
   ul.setScrollTop(ul.getScrollTop() + scrollIncrement * (top ? -1 : 1));
 }
예제 #5
0
 @Override
 protected void notifyShow() {
   super.notifyShow();
   updateRows(
       (int) Math.ceil((double) liveScroller.getScrollTop() / getCalculatedRowHeight()), true);
 }