pub struct EditableTableVecState<S>where
S: TableEditorState,{
pub mode: Mode,
pub table: TableState<RowSelection>,
pub editor: S,
pub data: Vec<<S as TableEditorState>::Value>,
pub mouse: MouseFlags,
}Expand description
State for EditTable.
Contains mode to differentiate between edit/non-edit.
This will lock the focus to the input line while editing.
Fields§
§mode: ModeEditing mode.
table: TableState<RowSelection>Backing table.
editor: SEditor
data: Vec<<S as TableEditorState>::Value>Data store
mouse: MouseFlagsImplementations§
Source§impl<S> EditableTableVecState<S>where
S: TableEditorState,
impl<S> EditableTableVecState<S>where
S: TableEditorState,
pub fn new(editor: S) -> EditableTableVecState<S>
pub fn named(name: &str, editor: S) -> EditableTableVecState<S>
Source§impl<S> EditableTableVecState<S>where
S: TableEditorState,
impl<S> EditableTableVecState<S>where
S: TableEditorState,
Sourcepub fn set_value(&mut self, data: Vec<<S as TableEditorState>::Value>)
pub fn set_value(&mut self, data: Vec<<S as TableEditorState>::Value>)
Set the edit data.
Sourcepub fn value(&mut self) -> Vec<<S as TableEditorState>::Value>
pub fn value(&mut self) -> Vec<<S as TableEditorState>::Value>
Get the edit data.
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Editing is active?
Sourcepub fn edit_new<'a>(
&mut self,
row: usize,
ctx: &'a <S as TableEditorState>::Context<'a>,
) -> Result<(), <S as TableEditorState>::Err>
pub fn edit_new<'a>( &mut self, row: usize, ctx: &'a <S as TableEditorState>::Context<'a>, ) -> Result<(), <S as TableEditorState>::Err>
Edit a new item inserted at the selected row.
Sourcepub fn edit<'a>(
&mut self,
col: usize,
row: usize,
ctx: &'a <S as TableEditorState>::Context<'a>,
) -> Result<(), <S as TableEditorState>::Err>
pub fn edit<'a>( &mut self, col: usize, row: usize, ctx: &'a <S as TableEditorState>::Context<'a>, ) -> Result<(), <S as TableEditorState>::Err>
Edit the item at the selected row.
Sourcepub fn commit<'a>(
&mut self,
ctx: &'a <S as TableEditorState>::Context<'a>,
) -> Result<(), <S as TableEditorState>::Err>
pub fn commit<'a>( &mut self, ctx: &'a <S as TableEditorState>::Context<'a>, ) -> Result<(), <S as TableEditorState>::Err>
Commit the changes in the editor.
pub fn commit_and_append<'a>( &mut self, ctx: &'a <S as TableEditorState>::Context<'a>, ) -> Result<(), <S as TableEditorState>::Err>
pub fn commit_and_edit<'a>( &mut self, ctx: &'a <S as TableEditorState>::Context<'a>, ) -> Result<(), <S as TableEditorState>::Err>
Trait Implementations§
Source§impl<S> Debug for EditableTableVecState<S>
impl<S> Debug for EditableTableVecState<S>
Source§impl<S> Default for EditableTableVecState<S>where
S: TableEditorState + Default,
impl<S> Default for EditableTableVecState<S>where
S: TableEditorState + Default,
Source§fn default() -> EditableTableVecState<S>
fn default() -> EditableTableVecState<S>
Returns the “default value” for a type. Read more
Source§impl<'a, S> HandleEvent<Event, &'a <S as TableEditorState>::Context<'a>, Result<Outcome, <S as TableEditorState>::Err>> for EditableTableVecState<S>where
S: HandleEvent<Event, &'a <S as TableEditorState>::Context<'a>, Result<Outcome, <S as TableEditorState>::Err>> + TableEditorState,
impl<'a, S> HandleEvent<Event, &'a <S as TableEditorState>::Context<'a>, Result<Outcome, <S as TableEditorState>::Err>> for EditableTableVecState<S>where
S: HandleEvent<Event, &'a <S as TableEditorState>::Context<'a>, Result<Outcome, <S as TableEditorState>::Err>> + TableEditorState,
Source§impl<S> HasFocus for EditableTableVecState<S>where
S: TableEditorState,
impl<S> HasFocus for EditableTableVecState<S>where
S: TableEditorState,
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container.
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
Source§impl<S> HasScreenCursor for EditableTableVecState<S>where
S: TableEditorState + HasScreenCursor,
impl<S> HasScreenCursor for EditableTableVecState<S>where
S: TableEditorState + HasScreenCursor,
Source§impl<S> RelocatableState for EditableTableVecState<S>where
S: TableEditorState + RelocatableState,
impl<S> RelocatableState for EditableTableVecState<S>where
S: TableEditorState + RelocatableState,
Auto Trait Implementations§
impl<S> !Freeze for EditableTableVecState<S>
impl<S> !RefUnwindSafe for EditableTableVecState<S>
impl<S> !Send for EditableTableVecState<S>
impl<S> !Sync for EditableTableVecState<S>
impl<S> Unpin for EditableTableVecState<S>
impl<S> !UnwindSafe for EditableTableVecState<S>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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