private boolean addFavouritesMenuItem(final List<Item> menuItems,
                                          final boolean singleSelection,
                                          final int priority) {
        final ExplorerNode primarySelection = getPrimarySelection();

        // Add the favourites menu item if an item is selected, and it's not a root-level node or a favourite folder
        // item
        if (singleSelection && primarySelection != null && primarySelection.getDepth() > 0) {
            final boolean isFavourite = primarySelection.hasNodeFlag(NodeFlag.FAVOURITE);
            menuItems.add(new IconMenuItem.Builder()
                    .priority(priority)
                    .icon(isFavourite
                            ? SvgImage.FAVOURITES_OUTLINE
                            : SvgImage.FAVOURITES)
                    .text(isFavourite
                            ? "Remove from Favourites"
                            : "Add to Favourites")
                    .command(() -> {
                        toggleFavourite(primarySelection.getDocRef(), isFavourite);
                        selectionModel.clear();
                    })
                    .build());
            return true;
        }
        return false;
    }
Highlights the supplied document item in the explorer tree.
stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java