HierarchicalTreeDataGridSource
struct · ferroui-treedatagrid-core · v0.5.0
struct HierarchicalTreeDataGridSource<M: TreeModel>
A source of a tree with columns: the rows of the root models, each expandable to the rows of its children through the expander column.
Members
newfrom_itemcolumnswith_columnitemsset_itemstyped_rowsrow_selectionis_sortedadd_row_expandingremove_row_expandingadd_row_expandedremove_row_expandedadd_row_collapsingremove_row_collapsingadd_row_collapsedremove_row_collapseddisposecollapsecollapse_allexpandexpand_allexpand_collapse_recursiveexpand_collapse_recursive_fromtry_get_model_atsortsort_by_columnget_model_childrenget_row_index
new
fn new(items: Models<M>) -> Rc<Self>
A source of items.
from_item
fn from_item(item: Rc<M>) -> Rc<Self>
A source of one root model.
columns
fn columns(self: &Self) -> &ColumnList<M>
with_column
fn with_column(self: &Rc<Self>, column: ColumnRef<M>) -> Rc<Self>
Adds a column (the reference's collection initializer Columns = { ... }).
items
fn items(self: &Self) -> Models<M>
set_items
fn set_items(self: &Self, value: Models<M>)
typed_rows
fn typed_rows(self: &Self) -> Rc<HierarchicalRows<M>>
The rows, created on first access.
Panics
When the source has no columns or no expander column (InvalidOperationException).
row_selection
fn row_selection(self: &Self) -> Option<Rc<TreeDataGridRowSelectionModel<M>>>
The selection of rows, if the selection is one (RowSelection).
is_sorted
fn is_sorted(self: &Self) -> bool
add_row_expanding
fn add_row_expanding(self: &Self, handler: Rc<RowEventHandler<M>>) -> u64
remove_row_expanding
fn remove_row_expanding(self: &Self, token: u64)
add_row_expanded
fn add_row_expanded(self: &Self, handler: Rc<RowEventHandler<M>>) -> u64
remove_row_expanded
fn remove_row_expanded(self: &Self, token: u64)
add_row_collapsing
fn add_row_collapsing(self: &Self, handler: Rc<RowEventHandler<M>>) -> u64
remove_row_collapsing
fn remove_row_collapsing(self: &Self, token: u64)
add_row_collapsed
fn add_row_collapsed(self: &Self, handler: Rc<RowEventHandler<M>>) -> u64
remove_row_collapsed
fn remove_row_collapsed(self: &Self, token: u64)
dispose
fn dispose(self: &Self)
Releases the rows (Dispose).
collapse
fn collapse(self: &Self, index: &IndexPath)
collapse_all
fn collapse_all(self: &Self)
expand
fn expand(self: &Self, index: &IndexPath)
expand_all
fn expand_all(self: &Self)
expand_collapse_recursive
fn expand_collapse_recursive(self: &Self, predicate: &dyn Fn(&Rc<M>) -> bool)
Expands the models for which predicate holds and collapses the others.
expand_collapse_recursive_from
fn expand_collapse_recursive_from(self: &Self, row: &Rc<HierarchicalRow<M>>, predicate: &dyn Fn(&Rc<M>) -> bool)
expand_collapse_recursive below row.
try_get_model_at
fn try_get_model_at(self: &Self, index: &IndexPath) -> Option<Rc<M>>
The model at index.
Panics
When the source has no expander column (InvalidOperationException).
sort
fn sort(self: &Self, comparison: Option<Comparison<M>>)
Sorts the rows by comparison.
sort_by_column
fn sort_by_column(self: &Self, column: &ColumnRef<M>, direction: ListSortDirection) -> bool
Sorts by column (one of the columns).
get_model_children
fn get_model_children(self: &Self, model: &Rc<M>) -> Option<Models<M>>
The child models of model.
Panics
When the source has no expander column (InvalidOperationException).
get_row_index
fn get_row_index(self: &Self, index: &IndexPath, from_row_index: usize) -> i32
The row index of the model at index, searched from from_row_index (-1: no row).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherINotifyPropertyChangedITreeDataGridSourceITreeDataGridSourceOf<M>IExpanderRowController<M>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.