Package com.cedarsolutions.dao.domain

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


    }

    /** 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

    @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

    /** 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

    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

        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

TOP

Related Classes of com.cedarsolutions.dao.domain.Pagination

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.