use of org.rstudio.core.client.jsonrpc.RpcObjectList in project rstudio by rstudio.
the class History method onHistoryShowContext.
@Handler
void onHistoryShowContext() {
ArrayList<Long> indexes = view_.getSelectedCommandIndexes();
if (indexes.size() != 1)
return;
final String command = view_.getSelectedCommands().get(0);
final Long min = indexes.get(0);
final long max = indexes.get(indexes.size() - 1) + 1;
final long start = Math.max(0, min - CONTEXT_LINES);
final long end = max + CONTEXT_LINES;
server_.getHistoryArchiveItems(start, end, new SimpleRequestCallback<RpcObjectList<HistoryEntry>>() {
@Override
public void onResponseReceived(RpcObjectList<HistoryEntry> response) {
ArrayList<HistoryEntry> entries = toList(response);
view_.showContext(command, entries, min - start, max - min);
}
});
}
use of org.rstudio.core.client.jsonrpc.RpcObjectList 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);
}
});
}
Aggregations