ColumnListBase
struct · ferroui-controls-treedatagrid · v0.5.0
struct ColumnListBase
ColumnListBase<TColumn>: an implementation of IColumns that stores its columns in a list.
Members
from_core_columnsadd_core_columnnewfrom_columnsthisnotifyingcountis_emptygettry_getto_vecindex_ofcontainsadd_collection_changedremove_collection_changedadd_layout_invalidatedremove_layout_invalidatedaddadd_rangeinsertremove_atremovesetmove_itemclearinsert_rangeremove_rangeresetcheck_reentrancycell_measuredget_column_atget_estimated_widthcommit_actual_widthsset_column_widthviewport_changed
from_core_columns
fn from_core_columns(columns: impl IntoIterator<Item = Rc<dyn core_models::IColumn>>, present: impl FnMut(&Rc<dyn core_models::IColumn>) -> Option<ColumnRef>) -> Rc<Self>
A list of the view columns of columns (the columns of a core source), in order; a column
that is not a view column (a neutral column of the core, which the presentation presents
through its options) is given to present, which returns its view column or None to
leave it out.
add_core_column
fn add_core_column(self: &Self, column: &dyn core_models::IColumn) -> bool
Adds the view of a core column; false when the core column is not a view column of this crate.
new
fn new() -> Rc<Self>
An empty list.
from_columns
fn from_columns(columns: impl IntoIterator<Item = ColumnRef>) -> Rc<Self>
A list of columns.
this
fn this(self: &Self) -> Rc<Self>
The shared list.
notifying
fn notifying(self: &Self) -> &NotifyingBase
The PropertyChanged of the list (Count, Item[]).
count
fn count(self: &Self) -> usize
is_empty
fn is_empty(self: &Self) -> bool
get
fn get(self: &Self, index: usize) -> ColumnRef
The column at index.
Panics
When index is out of range.
try_get
fn try_get(self: &Self, index: usize) -> Option<ColumnRef>
to_vec
fn to_vec(self: &Self) -> Vec<ColumnRef>
The columns, in order.
index_of
fn index_of(self: &Self, column: &ColumnRef) -> Option<usize>
The index of column, compared by identity.
contains
fn contains(self: &Self, column: &ColumnRef) -> bool
add_collection_changed
fn add_collection_changed(self: &Self, handler: Rc<ColumnsChangedHandler>) -> u64
CollectionChanged.
remove_collection_changed
fn remove_collection_changed(self: &Self, token: u64) -> bool
add_layout_invalidated
fn add_layout_invalidated(self: &Self, handler: Rc<dyn Fn() -> ()>) -> u64
LayoutInvalidated: the widths of the columns changed and the layout must run again.
remove_layout_invalidated
fn remove_layout_invalidated(self: &Self, token: u64) -> bool
add
fn add(self: &Self, column: ColumnRef)
add_range
fn add_range(self: &Self, columns: impl IntoIterator<Item = ColumnRef>)
Adds the columns one by one (AddRange).
insert
fn insert(self: &Self, index: usize, column: ColumnRef)
Inserts a column.
Panics
When index is greater than the count, or during a batch of another kind.
remove_at
fn remove_at(self: &Self, index: usize)
Removes the column at index.
Panics
When index is out of range, or during a batch of another kind.
remove
fn remove(self: &Self, column: &ColumnRef) -> bool
Removes column; false when it is not in the list.
set
fn set(self: &Self, index: usize, column: ColumnRef)
Replaces the column at index.
Panics
When index is out of range, or during a batch other than a reset.
move_item
fn move_item(self: &Self, old_index: usize, new_index: usize)
Moves the column at old_index to new_index (MoveItem).
Panics
When an index is out of range (ArgumentOutOfRangeException), or during a batch other
than a reset.
clear
fn clear(self: &Self)
Removes every column.
Panics
During a batch other than a reset.
insert_range
fn insert_range(self: &Self, index: usize, action: impl FnOnce(&mut dyn FnMut(ColumnRef) -> ()) -> ())
Inserts the columns action hands over, from index, with one notification
(InsertRange).
remove_range
fn remove_range(self: &Self, index: usize, count: usize)
Removes count columns from index with one notification (RemoveRange).
reset
fn reset(self: &Self, action: impl FnOnce(&Self) -> ())
Changes the list in action and raises one reset notification (Reset).
check_reentrancy
fn check_reentrancy(self: &Self)
Changes are allowed while a notification is raised only when one handler listens: a re-entrant change would make the arguments of later handlers invalid.
Panics
On a re-entrant change with more than one listener (InvalidOperationException).
cell_measured
fn cell_measured(self: &Self, column_index: i32, row_index: i32, size: Size) -> Size
The size a cell gets after it was measured at size (CellMeasured).
get_column_at
fn get_column_at(self: &Self, x: f64) -> (i32, f64)
The index and left edge of the column at x, or (-1, -1) (GetColumnAt).
get_estimated_width
fn get_estimated_width(self: &Self, constraint: f64) -> f64
The estimated total width of the columns in the viewport width constraint
(GetEstimatedWidth).
commit_actual_widths
fn commit_actual_widths(self: &Self)
Commits the widths of the columns, unless a batch defers them (CommitActualWidths).
set_column_width
fn set_column_width(self: &Self, column_index: i32, width: GridLength)
Sets the width of the column at column_index (SetColumnWidth).
viewport_changed
fn viewport_changed(self: &Self, viewport: Rect)
The viewport changed: star columns share its new width (ViewportChanged).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherDropINotifyPropertyChangedIColumnsIColumnLayoutBatchIColumnViewportEstimator
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.