pub struct EditVecState<S>where
S: EditorState,{
pub mode: Mode,
pub table: TableState<RowSelection>,
pub editor: S,
pub editor_focus: FocusFlag,
pub editor_data: Rc<RefCell<Vec<S::Data>>>,
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
editor_focus: FocusFlagFocus-flag for the whole editor widget.
editor_data: Rc<RefCell<Vec<S::Data>>>Data store
mouse: MouseFlagsImplementations§
source§impl<S> EditVecState<S>where
S: EditorState,
impl<S> EditVecState<S>where
S: EditorState,
source§impl<S> EditVecState<S>where
S: EditorState,
impl<S> EditVecState<S>where
S: EditorState,
sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Editing is active?
sourcepub fn edit_new(
&mut self,
row: usize,
ctx: &S::Context<'_>,
) -> Result<(), S::Err>
pub fn edit_new( &mut self, row: usize, ctx: &S::Context<'_>, ) -> Result<(), S::Err>
Edit a new item inserted at the selected row.
sourcepub fn edit(&mut self, row: usize, ctx: &S::Context<'_>) -> Result<(), S::Err>
pub fn edit(&mut self, row: usize, ctx: &S::Context<'_>) -> Result<(), S::Err>
Edit the item at the selected row.
sourcepub fn commit(&mut self, ctx: &S::Context<'_>) -> Result<(), S::Err>
pub fn commit(&mut self, ctx: &S::Context<'_>) -> Result<(), S::Err>
Commit the changes in the editor.
pub fn commit_and_append(&mut self, ctx: &S::Context<'_>) -> Result<(), S::Err>
pub fn commit_and_edit(&mut self, ctx: &S::Context<'_>) -> Result<(), S::Err>
Trait Implementations§
source§impl<S> Debug for EditVecState<S>
impl<S> Debug for EditVecState<S>
source§impl<S> Default for EditVecState<S>where
S: Default + EditorState,
impl<S> Default for EditVecState<S>where
S: Default + EditorState,
source§impl<'a, S> HandleEvent<Event, &'a <S as EditorState>::Context<'a>, Result<Outcome, <S as EditorState>::Err>> for EditVecState<S>
impl<'a, S> HandleEvent<Event, &'a <S as EditorState>::Context<'a>, Result<Outcome, <S as EditorState>::Err>> for EditVecState<S>
source§impl<S> HasFocus for EditVecState<S>where
S: EditorState,
impl<S> HasFocus for EditVecState<S>where
S: EditorState,
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§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container.
source§impl<S> HasScreenCursor for EditVecState<S>where
S: HasScreenCursor + EditorState,
impl<S> HasScreenCursor for EditVecState<S>where
S: HasScreenCursor + EditorState,
Auto Trait Implementations§
impl<S> !Freeze for EditVecState<S>
impl<S> !RefUnwindSafe for EditVecState<S>
impl<S> !Send for EditVecState<S>
impl<S> !Sync for EditVecState<S>
impl<S> Unpin for EditVecState<S>where
S: Unpin,
impl<S> !UnwindSafe for EditVecState<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