Interface EntityTableTreeModel

All Superinterfaces:
FilterTreeModel<Entity>
All Known Subinterfaces:
SwingEntityTableTreeModel
All Known Implementing Classes:
AbstractEntityTableTreeModel

public interface EntityTableTreeModel extends FilterTreeModel<Entity>

The included items of an EntityTableModel as a FilterTreeModel, arranged by a foreign key referencing the parent, from the table model entity type to itself.

The tree follows the included items, reloaded synchronously after each change, so it shows the rows the table model shows, siblings in the order of the rows. Sorting or filtering the table model does the same to the tree.

The selection is kept in sync with the table model selection both ways, an entity selected in the table model, or by item in the tree, having its ancestors expanded in the tree. The single selection mode of the tree follows the one of the table model, so change the latter.

An entity whose parent is not among the included items is an orphan, hidden along with everything below it, unless shown as a root, see orphansAsRoots(). An entity on a cycle of parents is reachable from no root, so neither it nor anything below it is in the tree. The included items reachable from no root are available via unreachable().

Edit the table model rather than the tree, since a change made via FilterTreeModel.nodes() lasts only until the next change to the included items.

The table model holds the listeners of the tree model weakly, so it does not keep a tree model no longer in use, one built for a dialog for example.

See Also: