@Override
    public void setIndicators(final IndicatorLines indicators) {
        this.indicators = indicators;
        final List<Annotation> annotations = new ArrayList<>();

        if (indicators != null) {
            for (Integer lineNumber : indicators.getLineNumbers()) {
                final Indicator indicator = indicators.getIndicator(lineNumber);

                for (final Entry<Severity, Set<StoredError>> entry : indicator.getErrorMap().entrySet()) {
                    for (final StoredError error : entry.getValue()) {
                        int row = 0;
                        int col = 0;

                        final Location location = error.getLocation();
                        if (location != null) {
                            row = Math.max(location.getLineNo() - 1, 0);
                            col = location.getColNo();
                        }

//                            GWT.log("row: " + row
//                                    + " col: " + col
//                                    + " severity: " + error.getSeverity()
//                                    + " msg: " + error.getMessage());

                        final Severity severity = error.getSeverity();
                        AceAnnotationType annotationType;
                        switch (severity) {
                            case INFO:
                                annotationType = AceAnnotationType.INFO;
                                break;
                            case WARNING:
                                annotationType = AceAnnotationType.WARNING;
                                break;
                            case ERROR:
                                annotationType = AceAnnotationType.ERROR;
                                break;
                            case FATAL_ERROR:
                                annotationType = AceAnnotationType.FATAL_ERROR;
                                break;
                            default:
                                throw new RuntimeException("Unexpected severity " + severity);
                        }

                        // Ace munges all the msgs together in one popup for annotations on the same line/col
                        // so add the severity as if we have some info + warnings then we get a warning
                        // icon whose popup contains all the msgs.
                        annotations.add(new Annotation(
                                row,
                                col,
                                error.getSeverity().toString() + " " + error.getMessage(),
                                annotationType));
                    }
                }
            }
        }

        // Ensure line numbers are visible if there are annotations.
        if (!annotations.isEmpty()) {
            getLineNumbersOption().setOn(true);
        }

        editor.setAnnotations(annotations);
        doLayout(indicatorsOption.isOn());
    }
This is a widget that can be used to edit text. It provides useful
functionality such as formatting, styling, line numbers and warning/error
markers.
stroom-core-client-widget/src/main/java/stroom/editor/client/view/EditorViewImpl.java