private void handleResponse(final AbstractFetchDataResult result) {

        if (result instanceof FetchDataResult) {
            final FetchDataResult fetchDataResult = (FetchDataResult) result;
            receivedSourceLocation = result.getSourceLocation();

            if (receivedSourceLocation != null
                    && lastResult != null
                    && receivedSourceLocation.isSameSource(lastResult.getSourceLocation())) {
                // If we encounter an exact char count for this source then hold onto it
                // so we can still show it if we page backwards
                if (fetchDataResult.getTotalCharacterCount().isExact()
                        || exactCharCount == null) {
                    exactCharCount = fetchDataResult.getTotalCharacterCount();
                }
            } else {
                exactCharCount = null;
                currentTextHighlight = null;
            }

            if (!textPresenter.getViewAsHexOption().isOnAndAvailable()) {
                recordDecoratedHighlight(receivedSourceLocation);
            }

            lastResult = fetchDataResult;
            setTitle(lastResult);
            setClassification(result.getClassification());

            updateEditor();
            updateNavigator(result);
            refreshProgressBar(true);
        } else {
            AlertEvent.fireError(
                    SourcePresenter.this,
                    "Unexpected type " + result.getClass().getName(),
                    null);
        }
    }
Will attempt to set the source range using the passed highlight, i.e. if the highlight
is towards the end of the data then it will set the range to enclose the highlight.
stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java