private <DOC extends DocumentProperty> Stream<MenuItem>
    installForDocumentType(TreeCell<DocumentProperty> treeCell, DOC node) {
        final MenuItem expandAll   = new MenuItem(EXPAND_ALL, ProjectTreeIcon.BOOK_OPEN.view());
        final MenuItem collapseAll = new MenuItem(COLLAPSE_ALL, ProjectTreeIcon.BOOK.view());

        expandAll.setOnAction(ev ->
            DocumentUtil.traverseOver(node)
                .filter(HasExpandedProperty.class::isInstance)
                .forEach(doc -> ((HasExpandedProperty) doc).expandedProperty().setValue(true))
        );

        collapseAll.setOnAction(ev ->
            DocumentUtil.traverseOver(node)
                .filter(HasExpandedProperty.class::isInstance)
                .forEach(doc -> ((HasExpandedProperty) doc).expandedProperty().setValue(false))
        );

        return Stream.of(expandAll, collapseAll);
    }
Default implementation of {@link ToggleExpandedAction}.

@author Emil Forslund
@since  3.0.17
tool-parent/tool-actions/src/main/java/com/speedment/tool/actions/internal/menues/ToggleExpandedActionImpl.java