Table trees
The table tree widget (EwTableTree) is a combination of the table list widget and icon tree widget. Like the table list widget, it displays attributes of items in columnar format. Like the icon tree widget, it also provides a hierarchical view of the items. The columns and their callbacks are created and set up in the same way as they are for the table list widget.
The following example creates a scrolled table tree widget. The column definitions and column callbacks are the same as the EwTableList example. The defaultActionCallback and childrenCallback methods are hooked and handled the same as in the EwIconTree example. The visualInfoCallback must be hooked for a table tree. Athough the icon and label information are not specified (they are specified as cell values), the hasChildren flag must be set.
Tip:
The first column of the table tree is used to show the hierarchy (typically, this column shows icons). Because child items are indented, this column should be defined with a larger width than a similar column for a table list widget. Also, it is a good idea to define this column as resizable.
 
Object subclass: #TableTreeExample
instanceVariableNames: "
classVariableNames: "
poolDictionaries: 'CwConstants EwConstants'
open
| shell tableList |
shell := CwTopLevelShell
createApplicationShell: 'shell'
argBlock: [:w | w title: 'Table Tree Example'].
tableList := shell
createScrolledTableTree: 'scrolled table tree'
argBlock: [:w | w
columns: self columns;
items: (Array with: Object);
selectionPolicy: XmCELLSINGLESELECT].
...
"Callbacks are hooked as in previous examples"
...
visualInfo: widget clientData: clientData callData: callData
"Specify whether the item has children. All other values are
provided using cell value callbacks."
callData hasChildren: callData item subclasses notEmpty
Last modified date: 01/29/2015