Package org.opoo.press

Examples of org.opoo.press.Pager


      if(toIndex > totalPosts){
        toIndex = totalPosts;
      }
      List<Post> pagePosts = posts.subList(fromIndex, toIndex);
     
      Pager pager = new Pager(pageNumber, totalPages, totalPosts, pageSize, pagePosts);
      if(pageNumber > 1){
        PageImpl impl = new PageImpl(site, page.getSource(), pager);
//        site.getPages().add(impl);
        pages[i] = impl;
        newPages.add(impl);
View Full Code Here


  public Page getPage(Page current, int targetPageNumber){
    if(current == null){
      log.warn("Current page is null, cannot found target page for pagenumber " + targetPageNumber);
      return null;
    }
    Pager pa = current.getPager();
    if(pa == null){
      log.warn("Current page is not one of a pigination page.");
      return null;
    }
    int currentPageNumber = pa.getPageNumber();
    if(currentPageNumber == targetPageNumber){
      return current;
    }else if(targetPageNumber > currentPageNumber){
      return getPage(pa.getNext(), targetPageNumber);
    }else{
      return getPage(pa.getPrevious(), targetPageNumber);
    }
  }
View Full Code Here

TOP

Related Classes of org.opoo.press.Pager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.