use of annis.gui.resultfetch.SingleResultFetchJob in project ANNIS by korpling.
the class QueryController method changeContext.
public void changeContext(PagedResultQuery originalQuery, Match match, long offset, int newContext, final VisualizerContextChanger visCtxChange, boolean left) {
try {
final PagedResultQuery newQuery = (PagedResultQuery) originalQuery.clone();
if (left) {
newQuery.setLeftContext(newContext);
} else {
newQuery.setRightContext(newContext);
}
newQuery.setOffset(offset);
Background.runWithCallback(new SingleResultFetchJob(match, newQuery), new FutureCallback<SaltProject>() {
@Override
public void onSuccess(SaltProject result) {
visCtxChange.updateResult(result, newQuery);
}
@Override
public void onFailure(Throwable t) {
ExceptionDialog.show(t, "Could not extend context.");
}
});
} catch (CloneNotSupportedException ex) {
log.error("Can't clone the query", ex);
}
}
Aggregations