Search in sources :

Example 1 with SingleResultFetchJob

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);
    }
}
Also used : PagedResultQuery(annis.gui.objects.PagedResultQuery) SaltProject(org.corpus_tools.salt.common.SaltProject) SingleResultFetchJob(annis.gui.resultfetch.SingleResultFetchJob)

Aggregations

PagedResultQuery (annis.gui.objects.PagedResultQuery)1 SingleResultFetchJob (annis.gui.resultfetch.SingleResultFetchJob)1 SaltProject (org.corpus_tools.salt.common.SaltProject)1