Package com.google.gwt.view.client

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


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


   }

   @Override
   public void onRangeChanged(final HasData<CommitInfo> display)
   {     
      final Range rng = display.getVisibleRange();
      final int start = rng.getStart();
      final int length = rng.getLength();

      if (length == 0)
         return;

      getHistory(
            rev_, fileFilter_.getValue(),
            start, length, searchText_.getValue(),
            new SimpleRequestCallback<RpcObjectList<CommitInfo>>("Error Fetching History")
            {
               @Override
               public void onResponseReceived(RpcObjectList<CommitInfo> response)
               {
                  super.onResponseReceived(response);
                  if (response.length() < length)
                     updateRowCount(start + response.length(), true);
                  updateRowData(start, response.toArrayList());
               }

               @Override
               public void onError(ServerError error)
               {
                  if (display instanceof AbstractHasData)
                  {
                     display.setVisibleRangeAndClearData(new Range(start, 0), true);
                  }
                  if (strategy_.getShowHistoryErrors())
                     super.onError(error);
                  else
                     Debug.logError(error);
View Full Code Here

   }

   private void refreshHistory()
   {
      strategy_.refreshCount();
      view_.getDataDisplay().setVisibleRangeAndClearData(new Range(0, 100), true);
   }
View Full Code Here

    public void setPageStart(int index) {

        HasRows display = getDisplay();

        if (display != null) {
            Range range = display.getVisibleRange();
            int pageSize = range.getLength();
            if (!isRangeLimited() && display.isRowCountExact()) {
                index = Math.min(index, display.getRowCount() - pageSize);
            }
            index = Math.max(0, index);
            if (index != range.getStart()) {
                display.setVisibleRange(index, pageSize);
            }
        }
    }
View Full Code Here

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

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

    // of rows and possibly repeating rows on the last and penultimate
    // page
    @Override
    public void setPageStart(int index) {
        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)
    protected String createText() {
        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 );
View Full Code Here

        }

        @Override
        public Range getVisibleRange()
        {
            return new Range(hostIndex, visibleHosts);
        }
View Full Code Here

        }

        @Override
        public Range getVisibleRange()
        {
            return new Range(hostIndex, visibleHosts);
        }
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.