Package br.gov.frameworkdemoiselle.pagination

Examples of br.gov.frameworkdemoiselle.pagination.PaginationContext


    throw new UnsupportedOperationException();
  }

  @Override
  public List<Item> loadItems(final int startIndex, final int count) {
    PaginationContext paginationContext = Beans.getReference(PaginationContext.class);
    Pagination pagination = paginationContext.getPagination(beanClass);

    pagination.setFirstResult(startIndex);

    List<E> resultList;
    if (list != null && !list.isEmpty()) {
View Full Code Here


   * Demoiselle's pagination mechanism needs a first call to "findAll" method to know how much records exists in the underlying persistence storage.
   * Because that, we first check the size, asking only for one record (0 to 1). After that the "PageSize" attribute will be set.
   */
  @Override
  public int size() {
    PaginationContext paginationContext = Beans.getReference(PaginationContext.class);
    Pagination pagination = paginationContext.getPagination(beanClass, true);

    // If size equals 0 then is the first call to container or the table has 0 record.
    // Lets minimize the overhead asking only for 1 record.
    if (size == 0) {
      // Store this list for further use. Lets minimize even more the overhead.
View Full Code Here

//  private static final long serialVersionUID = 1L;

  public static <T> Container create(Class<T> beanClass, ResultListHandler<T> handler) {
    GenericBeanFactory<T> queryFactory = new GenericBeanFactory<T>(beanClass, handler);
    PaginationContext paginationContext = Beans.getReference(PaginationContext.class);

    LazyQueryContainer lazyQueryContainer = new LazyQueryContainer(queryFactory, false, paginationContext
        .getPagination(beanClass, true).getPageSize());

    return lazyQueryContainer;
  }
View Full Code Here

  }

  protected Pagination getPagination() {
    if (pagination == null) {
      try {
        PaginationContext context = Beans.getReference(PaginationContext.class);
        pagination = context.getPagination(getBeanClass());

      } catch (ContextNotActiveException cause) {
        pagination = null;
      }
    }
View Full Code Here

  }

  protected Pagination getPagination() {
    if (pagination == null) {
      try {
        PaginationContext context = Beans.getReference(PaginationContext.class);
        pagination = context.getPagination(getBeanClass());

      } catch (ContextNotActiveException cause) {
        pagination = null;
      }
    }
View Full Code Here

  }

  protected Pagination getPagination() {
    if (pagination == null) {
      try {
        PaginationContext context = Beans.getReference(PaginationContext.class);
        pagination = context.getPagination(getBeanClass());

      } catch (ContextNotActiveException cause) {
        pagination = null;
      }
    }
View Full Code Here

  }

  protected Pagination getPagination() {
    if (pagination == null) {
      try {
        PaginationContext context = Beans.getReference(PaginationContext.class);
        pagination = context.getPagination(getBeanClass());

      } catch (ContextNotActiveException cause) {
        pagination = null;
      }
    }
View Full Code Here

  }

  protected Pagination getPagination() {
    if (pagination == null) {
      try {
        PaginationContext context = Beans.getReference(PaginationContext.class);
        pagination = context.getPagination(getBeanClass());

      } catch (ContextNotActiveException cause) {
        pagination = null;
      }
    }
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.pagination.PaginationContext

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.