Examples of Pagination


Examples of com.cedarsolutions.dao.domain.Pagination

    /** Test clear() when a display is set. */
    @Test public void testClearWithDisplay() {
        IBackendDataRenderer<String, String> renderer = createRenderer();
        BackendDataSource<String, String> dataSource = new DataSource(renderer);
        Pagination pagination = dataSource.getPagination();
        dataSource.clear();
        assertNotSame(pagination, dataSource.getPagination());
        assertEquals(new Pagination(renderer.getPageSize()), dataSource.getPagination());
        verify(renderer.getDisplay()).setVisibleRangeAndClearData(new Range(0, renderer.getPageSize()), true);
    }
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    }

    /** Test applyResults(), with no selection model. */
    @SuppressWarnings("unchecked")
    @Test public void testApplyResultsNoSelectionModel() {
        Pagination pagination = mock(Pagination.class);
        when(pagination.getTotalRows()).thenReturn(57);
        when(pagination.isTotalFinalized()).thenReturn(false);

        PaginatedResults<String> results = (PaginatedResults<String>) mock(PaginatedResults.class);
        when(results.getPagination()).thenReturn(pagination);

        IBackendDataRenderer<String, String> renderer = createRenderer();
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    }

    /** Test applyResults(), with a selection model, no visible items. */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Test public void testApplyResultsWithSelectionModel() {
        Pagination pagination = mock(Pagination.class);
        when(pagination.getTotalRows()).thenReturn(57);
        when(pagination.isTotalFinalized()).thenReturn(false);

        PaginatedResults<String> results = (PaginatedResults<String>) mock(PaginatedResults.class);
        when(results.getPagination()).thenReturn(pagination);

        IBackendDataRenderer<String, String> renderer = createRenderer();
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    }

    /** Test applyResults(), with a selection model, with visible items. */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Test public void testApplyResultsWithVisibleItems() {
        Pagination pagination = mock(Pagination.class);
        when(pagination.getTotalRows()).thenReturn(57);
        when(pagination.isTotalFinalized()).thenReturn(false);

        PaginatedResults<String> results = (PaginatedResults<String>) mock(PaginatedResults.class);
        when(results.getPagination()).thenReturn(pagination);

        IBackendDataRenderer<String, String> renderer = createRenderer();
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    @Test public void testConstructor() {
        IBackendDataRenderer<String, String> renderer = createRenderer();
        BackendDataSource<String, String> dataSource = new DataSource(renderer);
        assertNotNull(dataSource);
        assertSame(renderer, dataSource.getRenderer());
        assertEquals(new Pagination(renderer.getPageSize()), dataSource.getPagination());
        assertNotNull(dataSource.getDataProvider());
        assertSame(renderer.getDisplay(), dataSource.getDisplay());
        assertEquals(renderer.getSearchCriteria(), dataSource.getSearchCriteria());
        assertEquals(renderer.getPageSize(), dataSource.getPageSize());
    }
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    /** Test clear() when no display is set. */
    @Test public void testClearNoDisplay() {
        IBackendDataRenderer<String, String> renderer = createRenderer();
        BackendDataSource<String, String> dataSource = new DataSource(renderer);
        Pagination pagination = dataSource.getPagination();
        when(renderer.getDisplay()).thenReturn(null);
        dataSource.clear();
        assertNotSame(pagination, dataSource.getPagination());
        assertEquals(new Pagination(renderer.getPageSize()), dataSource.getPagination());
    }
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

    private boolean retrieveActive;

    /** Create a data source connected to a renderer. */
    public BackendDataSource(IBackendDataRenderer<T, C> renderer) {
        this.renderer = renderer;
        this.pagination = new Pagination(renderer.getPageSize());
        this.dataProvider = new BackendDataProvider<T, C>(this);
        this.retrieveActive = false;
    }
View Full Code Here

Examples of com.cedarsolutions.dao.domain.Pagination

        return this.pagination.getPageSize();
    }

    /** Clear the data provider and retrieve new data from the back-end. */
    public void clear() {
        this.pagination = new Pagination(this.getPageSize());
        if (this.getDisplay() != null) {
            // Reset the display so that we're rendering the first page again
            this.getDisplay().setVisibleRangeAndClearData(new Range(0, this.getPageSize()), true);
        }
    }
View Full Code Here

Examples of com.common.web.support.pagination.Pagination

        limit = Integer.valueOf(limitParam);
      } catch (Exception e) {
        isPagination = false;
      }
      if (isPagination) {
        Pagination p = null;
        try {
          JSONObject sort = JSONArray.fromObject(request
              .getParameter("sort")).getJSONObject(0);
          if (sort != null) {
            p = new Pagination(start, limit,
                sort.getString("property"),
                sort.getString("direction"));
          } else {
            p = new Pagination(start, limit);
          }
        } catch (Exception e) {
          p = new Pagination(start, limit);
        }
        PaginationUtils.setPagination(p);
      }
    }
    return true;
View Full Code Here

Examples of com.eatle.utils.Pagination

    queryMap.put("restaurantId", 1);
//    queryMap.put("communityName", "花");
//    queryMap.put("pinyinName", "果");
//    queryMap.put("districtName", "观");
   
    Pagination page = communityRestaurantService.getSendCommunitiesByRestaurantId(queryMap, 1, 10);
    for(Object s : page.getItems())
    {
      System.out.println(((Community) s).getName() + "   " + ((Community) s).getDistrictName());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.