@SuppressWarnings("unchecked")
    protected void showDocument(final DocRef docRef,
                                final MyPresenterWidget<?> documentEditPresenter,
                                final Handler closeHandler,
                                final DocumentTabData tabData,
                                final boolean fullScreen,
                                final CommonDocLinkTab selectedTab,
                                final TaskMonitorFactory taskMonitorFactory) {
        final RestErrorHandler errorHandler = caught ->
                AlertEvent.fireError(
                        DocumentPlugin.this,
                        "Unable to load document " + docRef, caught.getMessage(),
                        null);

        final Consumer<D> loadConsumer = doc -> {
            if (doc == null) {
                AlertEvent.fireError(DocumentPlugin.this, "Unable to load document " + docRef, null);
            } else {
                if (selectedTab != null) {
                    if (documentEditPresenter instanceof DocumentEditTabPresenter<?, ?>) {
                        ((DocumentEditTabPresenter<?, ?>) documentEditPresenter).selectCommonTab(selectedTab);
                    } else if (documentEditPresenter instanceof LinkTabPanelPresenter) {
                        ((LinkTabPanelPresenter) documentEditPresenter).selectCommonTab(selectedTab);
                    }
                }
                // Read the newly loaded document.
                if (documentEditPresenter instanceof HasDocumentRead) {
                    // Check document permissions and read.
                    securityContext
                            .hasDocumentPermission(
                                    docRef,
                                    DocumentPermission.EDIT,
                                    allowUpdate -> {
                                        ((HasDocumentRead<D>) documentEditPresenter).read(
                                                getDocRef(doc),
                                                doc,
                                                !allowUpdate);
                                        // Open the tab.
                                        if (fullScreen) {
                                            showFullScreen(documentEditPresenter);
                                        } else {
                                            contentManager.open(closeHandler, tabData, documentEditPresenter);
                                        }
                                    },
                                    throwable -> AlertEvent.fireErrorFromException(this, throwable, null),
                                    taskMonitorFactory);
                } else {
                    // Open the tab.
                    if (fullScreen) {
                        showFullScreen(documentEditPresenter);
                    } else {
                        contentManager.open(closeHandler, tabData, documentEditPresenter);
                    }
                }
            }
        };

        // Load the document and show the tab.
        load(docRef, loadConsumer, errorHandler, taskMonitorFactory);
    }
4. This method will open a document and show it in the content pane with the desired
selectedTab
stroom-core-client/src/main/java/stroom/document/client/DocumentPlugin.java