major
nice-to-have
minor
The TreeComponent, TreeTableComponent, and ScriptingRecorder display trees that, until now, could only be expanded and collapsed node by node. The TreeGrid, on the other hand, includes buttons that allow you to expand and collapse the entire tree at once.
Improvement
These buttons should also be available in the components mentioned above. However, they should be limited to finite trees.
Usage
As in the Grid, the buttons are registered automatically.
To integrate them, add the following to the corresponding config interface: {{{#!java /** @see com.top_logic.basic.reflect.DefaultMethodInvoker */ Lookup LOOKUP = MethodHandles.lookup();
@Override default void modifyIntrinsicCommands(CommandRegistry registry) { AbstractTreeComponent.Config.super.modifyIntrinsicCommands(registry); registry.registerButton(ExpandCollapseAll.Config.EXPAND_ID); registry.registerButton(ExpandCollapseAll.Config.COLLAPSE_ID); } }}}
Due to technical differences, there are two types of buttons:
- ExpandCollapseAll for AbstractTreeComponent
- TreeTableExpandCollapseAll for AbstractTreeTableComponent
Test
- No automated test: The effort required for testing would be greater than that for implementation.
- In the TL demo, verify in the following views that both buttons are displayed in the burger menu:
- ScriptingGui
- Tables -> Tree-Based Table
- Documentation
- In the "Structures" tab, the "Expand All" button must not be displayed: The tree is infinite. The "Collapse All" button, on the other hand, should be displayed.