use of com.google.gwt.view.client.Range in project rstudio by rstudio.
the class HistoryAsyncDataProvider method onRangeChanged.
@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);
}
});
}
use of com.google.gwt.view.client.Range in project blogwt by billy1380.
the class SimplePager method createText.
/**
* Get the text to display in the pager that reflects the state of the pager.
*
* @return the text
*/
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) + (exact ? " of " : " of over ") + formatter.format(dataSize);
}
use of com.google.gwt.view.client.Range in project blogwt by billy1380.
the class GeneratedDownloadController method onRangeChanged.
/* (non-Javadoc)
*
* @see
* com.google.gwt.view.client.AbstractDataProvider#onRangeChanged(com.google
* .gwt.view.client.HasData) */
@Override
protected void onRangeChanged(HasData<GeneratedDownload> display) {
Range range = display.getVisibleRange();
pager.start(Integer.valueOf(range.getStart())).count(Integer.valueOf(range.getLength()));
fetchGeneratedDownloads();
}
use of com.google.gwt.view.client.Range in project blogwt by billy1380.
the class PageController method onRangeChanged.
/* (non-Javadoc)
*
* @see
* com.google.gwt.view.client.AbstractDataProvider#onRangeChanged(com.google
* .gwt.view.client.HasData) */
@Override
protected void onRangeChanged(HasData<Page> display) {
Range range = display.getVisibleRange();
pager.start(Integer.valueOf(range.getStart())).count(Integer.valueOf(range.getLength()));
fetchPages();
}
use of com.google.gwt.view.client.Range in project blogwt by billy1380.
the class PermissionController method onRangeChanged.
/* (non-Javadoc)
*
* @see
* com.google.gwt.view.client.AbstractDataProvider#onRangeChanged(com.google
* .gwt.view.client.HasData) */
@Override
protected void onRangeChanged(HasData<Permission> display) {
Range range = display.getVisibleRange();
pager.start(Integer.valueOf(range.getStart())).count(Integer.valueOf(range.getLength()));
fetchPermissions();
}
Aggregations