public void linkToEditor(final EditorPresenter editorPresenter) {
        Objects.requireNonNull(editorPresenter);

        // Set up the insert handler
        registerHandler(addInsertHandler(insertEditorTextEvent -> {
            if (InsertType.SNIPPET.equals(insertEditorTextEvent.getInsertType())) {
                editorPresenter.insertSnippet(insertEditorTextEvent.getText());
                editorPresenter.focus();
            } else if (insertEditorTextEvent.getInsertType().isInsertable()) {
                editorPresenter.insertTextAtCursor(insertEditorTextEvent.getText());
                editorPresenter.focus();
            }
        }));

        // This glues the editor code completion to the QueryHelpPresenter's completion provider
        // Need to do this via addAttachHandler so the editor is fully loaded
        // else it moans about the id not being a thing on the AceEditor
        editorPresenter.getWidget().addAttachHandler(event ->
                editorPresenter.registerCompletionProviders(getKeyedAceCompletionProvider()));
    }
Associate this {@link QueryHelpPresenter} with an editor. The editor's will be set to use
this {@link QueryHelpPresenter} as its completion provider and items inserted using the
query help menu will be inserted into the editor.
stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpPresenter.java