class ToggleExpandedActionImpl
    implements AbstractToolAction, ToggleExpandedAction {

    static final String EXPAND_ALL   = "Expand All";
    static final String  COLLAPSE_ALL = "Collapse All";

    @Override
    public void installMenuItems(ProjectTreeComponent projectTree) {
        projectTree.installContextMenu(DbmsProperty.class, this::installForDocumentType);
        projectTree.installContextMenu(SchemaProperty.class, this::installForDocumentType);
        projectTree.installContextMenu(TableProperty.class, this::installForDocumentType);
    }

    private <DOC extends DocumentProperty> Stream<MenuItem>
    installForDocumentType(TreeCell<DocumentProperty> treeCell, DOC node) {<FILL_FUNCTION_BODY>}
}

        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);
    
<no_super_class>