private void addNewMenuItem(final List<Item> menuItems,
                                final boolean singleSelection,
                                final Map<ExplorerNode, ExplorerNodePermissions> documentPermissionMap,
                                final ExplorerNode primarySelection,
                                final DocumentTypes documentTypes) {
        boolean enabled = false;
        List<Item> children = null;

        // Only allow the new menu to appear if we have a single selection.
        if (singleSelection && primarySelection != null) {
            // Add 'New' menu item.
            final ExplorerNodePermissions documentPermissions = documentPermissionMap.get(primarySelection);
            children = createNewMenuItems(primarySelection, documentPermissions, documentTypes);
            enabled = !children.isEmpty();
        }

        final Item newItem = new IconParentMenuItem.Builder()
                .priority(1)
                .icon(SvgImage.ADD)
                .text("New")
                .children(children)
                .enabled(enabled)
                .build();
        menuItems.add(newItem);
        menuItems.add(new Separator(2));
    }
Highlights the supplied document item in the explorer tree.
stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java