pub struct CellSelectionModel { /* private fields */ }Expand description
Cell-level selection state for TableSelectionMode::SingleCell /
MultiCell. Tracks (row, col) pairs in visible-index space.
Mirrors teksilo_data::SelectionModel’s API surface (signal-backed,
auto-adjustable on data mutations) but keyed by (row, col) instead of
row alone.
Implementations§
Source§impl CellSelectionModel
impl CellSelectionModel
Sourcepub fn new(mode: TableSelectionMode) -> Self
pub fn new(mode: TableSelectionMode) -> Self
Construct a model. Panics if mode is not a cell mode —
callers in row mode should use teksilo_data::SelectionModel.
pub fn mode(&self) -> TableSelectionMode
pub fn selection_signal(&self) -> Signal<BTreeSet<(usize, usize)>>
pub fn is_selected(&self, row: usize, col: usize) -> bool
pub fn count(&self) -> usize
Sourcepub fn select(&self, row: usize, col: usize)
pub fn select(&self, row: usize, col: usize)
Replace the selection with the single cell (row, col) and set
the anchor.
Sourcepub fn toggle(&self, row: usize, col: usize)
pub fn toggle(&self, row: usize, col: usize)
Toggle the cell (row, col) (Ctrl-click). In SingleCell mode
this behaves like select.
Sourcepub fn extend_to(&self, row: usize, col: usize)
pub fn extend_to(&self, row: usize, col: usize)
Extend the selection to include the rectangular range from the
anchor to (row, col). In SingleCell mode this falls back to
select.
Sourcepub fn select_all(&self, row_count: usize, col_count: usize)
pub fn select_all(&self, row_count: usize, col_count: usize)
Select every cell in 0..row_count × 0..col_count.
pub fn clear(&self)
Sourcepub fn adjust_for_row_insert(&self, at_row: usize, count: usize)
pub fn adjust_for_row_insert(&self, at_row: usize, count: usize)
Adjust selection after count rows are inserted starting at
at_row. Existing selections at indices >= at_row shift up.
Sourcepub fn adjust_for_row_remove(&self, at_row: usize, count: usize)
pub fn adjust_for_row_remove(&self, at_row: usize, count: usize)
Adjust selection after count rows starting at at_row are
removed. Selections within the removed range are dropped; later
rows shift down.
Sourcepub fn adjust_for_row_move(&self, from: usize, to: usize, count: usize)
pub fn adjust_for_row_move(&self, from: usize, to: usize, count: usize)
Adjust selection after a block of count rows moved from from to
to (a post-removal index, matching ListModel::move_item). Selected
cells follow their rows; columns are untouched.
Sourcepub fn adjust_for_column_insert(&self, at_col: usize, count: usize)
pub fn adjust_for_column_insert(&self, at_col: usize, count: usize)
Adjust selection after count columns are inserted at at_col.
Reserved for future dynamic-column support. TableView/TreeTableView
columns are declared once via .add_column()/.columns() and are
static for the widget’s lifetime — there is no runtime insert/remove
API today, so nothing calls this. A column reorder or pin-toggle
permutes positions instead (see remap_columns),
which is what the current views actually use. Kept (not removed) as
public API in case a future dynamic-column feature needs the
offset-shift semantics this and adjust_for_column_remove
already implement and test.
Sourcepub fn adjust_for_column_remove(&self, at_col: usize, count: usize)
pub fn adjust_for_column_remove(&self, at_col: usize, count: usize)
Adjust selection after count columns starting at at_col are
removed.
Reserved for future dynamic-column support — see the doc comment on
adjust_for_column_insert; nothing
calls this today for the same reason.
Trait Implementations§
Source§impl Clone for CellSelectionModel
impl Clone for CellSelectionModel
Auto Trait Implementations§
impl !RefUnwindSafe for CellSelectionModel
impl !Send for CellSelectionModel
impl !Sync for CellSelectionModel
impl !UnwindSafe for CellSelectionModel
impl Freeze for CellSelectionModel
impl Unpin for CellSelectionModel
impl UnsafeUnpin for CellSelectionModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more