@Override
    public void render(final Context context, final T_ROW value, final SafeHtmlBuilder sb) {
        if (value == null) {
            sb.append(SafeHtmlUtils.EMPTY_SAFE_HTML);
        } else {
            final DocRef docRef = NullSafe.get(value, docRefFunction);
            final SafeHtml cellHtmlText = cellTextFunction.apply(value);
            String cssClasses = "docRefLinkText";
            final String additionalClasses = cssClassFunction.apply(value);
            if (additionalClasses != null) {
                cssClasses += " " + additionalClasses;
            }
            final SafeHtml textDiv = template.div(cssClasses, cellHtmlText);

            final String containerClasses = String.join(
                    " ",
                    HOVER_ICON_CONTAINER_CLASS_NAME,
                    "docRefLinkContainer");

            sb.appendHtmlConstant("<div class=\"" + containerClasses + "\">");
            if (docRef != null && showIcon) {
                final DocumentType documentType = DocumentTypeRegistry.get(docRef.getType());
                if (documentType != null) {
                    final SvgImage svgImage = documentType.getIcon();
                    final SafeHtml iconDiv = SvgImageUtil.toSafeHtml(
                            documentType.getDisplayType(),
                            svgImage,
                            ICON_CLASS_NAME,
                            "docRefLinkIcon");
                    sb.append(iconDiv);
                }
            }

            sb.append(textDiv);

            // Add copy and open links.
            if (docRef != null) {
                // This DocRefCell gets used for pipeline props which sometimes are a docRef
                // and other times just a simple string
                final SafeHtml copy = SvgImageUtil.toSafeHtml(
                        SvgImage.COPY,
                        ICON_CLASS_NAME,
                        COPY_CLASS_NAME,
                        HOVER_ICON_CLASS_NAME);
                sb.append(template.divWithToolTip(
                        "Copy name '" + docRef.getName() + "' to clipboard",
                        copy));

                if (docRef.getUuid() != null || allowLinkByName) {
                    final SafeHtml open = SvgImageUtil.toSafeHtml(
                            SvgImage.OPEN,
                            ICON_CLASS_NAME,
                            OPEN_CLASS_NAME,
                            HOVER_ICON_CLASS_NAME);
                    sb.append(template.divWithToolTip(
                            "Open " + docRef.getType() + " " + docRef.getName() + " in new tab",
                            open));
                }
            }

            sb.appendHtmlConstant("</div>");
        }
    }
@param showIcon         Set to true to show the type icon next to the text
@param cellTextFunction Function to provide the cell 'text' in HTML form.
@param docRefFunction   Function to provide a doc ref if the value can give us one.
@param cssClassFunction Function to provide additional css class names.
stroom-core-client/src/main/java/stroom/data/client/presenter/DocRefCell.java