@Override
    public void setDashboardContext(final DashboardContext dashboardContext) {
        super.setDashboardContext(dashboardContext);
        registerHandler(dashboardContext.addComponentChangeHandler(event -> {
            if (getTextSettings() != null) {
                final Component component = event.getComponent();
                if (getTextSettings().getTableId() == null) {
                    if (component instanceof HasComponentSelection) {
                        currentTablePresenter = (HasComponentSelection) component;
                        update(currentTablePresenter);
                    }
                } else if (Objects.equals(getTextSettings().getTableId(), event.getComponentId())) {
                    if (component instanceof HasComponentSelection) {
                        currentTablePresenter = (HasComponentSelection) component;
                        update(currentTablePresenter);
                    }
                }
            }
        }));
    }
The ranges returned are line/col positions in the input text. Thus the input text should
not be changed/formatted after the highlight ranges have been generated.
stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java