Class AbstractEntityTableTreeModel<M extends FilterTreeModel<Entity>>
- Type Parameters:
M- the type of the underlying tree model
- All Implemented Interfaces:
FilterTreeModel<Entity>,EntityTableTreeModel
A base class for EntityTableTreeModel implementations, based on a tree model built by a toolkit, a
javax.swing.tree.TreeModel based one for example, the logic, arranging the rows and keeping the selections in
sync, living here.
The FilterTreeModel methods delegate to the tree model, see treeModel().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceBuilds the underlying tree model of anEntityTableTreeModel.Nested classes/interfaces inherited from interface is.codion.framework.model.EntityTableTreeModel
EntityTableTreeModel.Builder<B extends EntityTableTreeModel.Builder<B>>, EntityTableTreeModel.UnreachableItemsNested classes/interfaces inherited from interface is.codion.common.model.component.tree.FilterTreeModel
FilterTreeModel.Expansion<T>, FilterTreeModel.Loader<T>, FilterTreeModel.Nodes<T>, FilterTreeModel.NodesListener<T>, FilterTreeModel.VisibleNodes<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEntityTableTreeModel(AbstractEntityTableTreeModelBuilder<?> builder, AbstractEntityTableTreeModel.TreeModelBuilder<M> treeModel) -
Method Summary
Modifier and TypeMethodDescriptionfinal FilterTreeModel.Expansion<Entity> final FilterTreeModel.Nodes<Entity> nodes()final StateControls whether entities whose parent is not among the included items are shown as roots, otherwise they are hidden, along with everything below them, false by default.final StateControls whether siblings with children come before those without, in the order of the rows within each group, otherwise the siblings are in the order of the rows, false by default.The selection, over theFilterTreeModel.visible()nodes, by item, withTreeSelection.paths()addressing particular nodes, the same item appearing in several places.final FilterTreeSort<Entity> sort()toString()protected final Mvisible()
-
Constructor Details
-
AbstractEntityTableTreeModel
protected AbstractEntityTableTreeModel(AbstractEntityTableTreeModelBuilder<?> builder, AbstractEntityTableTreeModel.TreeModelBuilder<M> treeModel) - Parameters:
builder- the buildertreeModel- builds the underlying tree model
-
-
Method Details
-
orphansAsRoots
Description copied from interface:EntityTableTreeModelControls whether entities whose parent is not among the included items are shown as roots, otherwise they are hidden, along with everything below them, false by default.- Specified by:
orphansAsRootsin interfaceEntityTableTreeModel- Returns:
- the
Statecontrolling whether orphans are shown as roots
-
parentsFirst
Description copied from interface:EntityTableTreeModelControls whether siblings with children come before those without, in the order of the rows within each group, otherwise the siblings are in the order of the rows, false by default.- Specified by:
parentsFirstin interfaceEntityTableTreeModel- Returns:
- the
Statecontrolling whether parents come first
-
unreachable
- Specified by:
unreachablein interfaceEntityTableTreeModel- Returns:
- the
EntityTableTreeModel.UnreachableItems, the included items reachable from no root, so not in the tree
-
nodes
- Specified by:
nodesin interfaceFilterTreeModel<M extends FilterTreeModel<Entity>>- Returns:
- the
FilterTreeModel.Nodesproviding the structure, loading, mutation and filtering
-
expansion
- Specified by:
expansionin interfaceFilterTreeModel<M extends FilterTreeModel<Entity>>- Returns:
- the
FilterTreeModel.Expansioncontrolling the expanded nodes
-
visible
- Specified by:
visiblein interfaceFilterTreeModel<M extends FilterTreeModel<Entity>>- Returns:
- the
FilterTreeModel.VisibleNodes, the rows a view displays
-
selection
Description copied from interface:FilterTreeModelThe selection, over the
FilterTreeModel.visible()nodes, by item, withTreeSelection.paths()addressing particular nodes, the same item appearing in several places. Selecting a node hidden below a collapsed ancestor expands its ancestors, and a node not yet loaded is selected viaTreeSelection.set(NodePath).The selection is kept by path, through refreshes, filtering, sorting and expansion. A selected node hidden by collapsing one of its ancestors is replaced by its nearest visible ancestor, and one removed or excluded is dropped from the selection.
- Specified by:
selectionin interfaceFilterTreeModel<M extends FilterTreeModel<Entity>>- Returns:
- the selection
-
sort
- Specified by:
sortin interfaceFilterTreeModel<M extends FilterTreeModel<Entity>>- Returns:
- the
FilterTreeSortinstance used by this model
-
toString
-
treeModel
- Returns:
- the underlying tree model
-