Package com.google.gwt.view.client

Examples of com.google.gwt.view.client.Range


                AbstractProxySearchActivity.this.onRangeChanged(hasData, hasData.getVisibleRange(), view.getColumnSortList());
            }
        });

        // Select the current page range to load (by default or from place tokens)
        Range range = hasData.getVisibleRange();
        if(currentPlace.getFirstResult() > 0 ||
                (currentPlace.getMaxResults() != range.getLength() && currentPlace.getMaxResults() > 0))
        {
            range = new Range(currentPlace.getFirstResult(), currentPlace.getMaxResults());
        }

        loadItems(searchCriteria, range);
    }
View Full Code Here


        return null;
    }

    protected void loadItems(final S searchCriteria) {
        // Select the current page size to load
        final Range currentRange = view.asHasData().getVisibleRange();
        loadItems(searchCriteria, new Range(0, currentRange.getLength()));
    }
View Full Code Here

        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

   */
  protected String createText() {
    // Default text is 1 based.
    NumberFormat formatter = NumberFormat.getFormat("#,###");
    HasRows display = getDisplay();
    Range range = display.getVisibleRange();
    int pageStart = range.getStart() + 1;
    int pageSize = range.getLength();
    int dataSize = display.getRowCount();
    int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
    endIndex = Math.max(pageStart, endIndex);
    boolean exact = display.isRowCountExact();
    return formatter.format(pageStart) + "-" + formatter.format(endIndex)
View Full Code Here

    @Override
    public void nextPage() {
        // Page forward by an exact size rather than the number of visible
        // rows as is in the norm in the underlying implementation
        if (getDisplay() != null) {
            Range range = getDisplay().getVisibleRange();
            setPageStart(range.getStart() + getPageSize());
        }
    }
View Full Code Here

    @Override
    public void previousPage() {
        // Page back by an exact size rather than the number of visible rows
        // as is in the norm in the underlying implementation
        if (getDisplay() != null) {
            Range range = getDisplay().getVisibleRange();
            setPageStart(range.getStart() - getPageSize());
        }
    }
View Full Code Here

    public void setPageStart(int index) {
        // Override so the last page is shown with a number of rows less
        // than the pageSize rather than always showing the pageSize number
        // of rows and possibly repeating rows on the last and penultimate page
        if (getDisplay() != null) {
            Range range = getDisplay().getVisibleRange();
            int displayPageSize = getPageSize();
            if (isRangeLimited() && getDisplay().isRowCountExact()) {
                displayPageSize = Math.min(getPageSize(), getDisplay().getRowCount() - index);
            }
            index = Math.max(0, index);
            if (index != range.getStart()) {
                getDisplay().setVisibleRange(index, displayPageSize);
            }
        }
    }
View Full Code Here

        // (otherwise you get "1-1 of 1"). Not internationalised (but
        // neither is SimplePager).  There's also a special case if the
        // final page is empty: we get "> 10 of 10" instead of "11 of 10".
        NumberFormat formatter = NumberFormat.getFormat("#,###");
        HasRows display = getDisplay();
        Range range = display.getVisibleRange();
        int pageStart = range.getStart() + 1;
        int size = range.getLength();
        int dataSize = display.getRowCount();
        int endIndex = Math.min(dataSize, pageStart + size - 1);
        endIndex = Math.max(pageStart, endIndex);
        boolean exact = display.isRowCountExact();
        if (dataSize == 0) {
View Full Code Here

    }

    /** True if we know for certain there is a last page beyond the one currently displayed. */
    protected boolean hasLastPage() {
        HasRows display = getDisplay();
        Range range = display.getVisibleRange();
        int pageStart = range.getStart() + 1;
        int size = range.getLength();
        int dataSize = display.getRowCount();
        int endIndex = Math.min(dataSize, pageStart + size - 1);
        endIndex = Math.max(pageStart, endIndex);
        boolean exact = display.isRowCountExact();
        if (dataSize == 0) {
View Full Code Here

     }

    @Override
    protected void onRangeChanged(HasData<EventProxy> display) {

      final Range range = display.getVisibleRange();

      requestFactory.eventRequest()
          .findEventEntries(range.getStart(), range.getLength())
          .fire(new Receiver<List<EventProxy>>() {
            @Override
            public void onSuccess(List<EventProxy> response) {
              updateRowData(0, response);
            }
View Full Code Here

TOP

Related Classes of com.google.gwt.view.client.Range

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.