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 as EditorState>::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 as EditorState>::Data>>>Data store
mouse: MouseFlagsImplementations§
Source§impl<S> EditVecState<S>where
S: EditorState,
impl<S> EditVecState<S>where
S: EditorState,
pub fn new(editor: S) -> EditVecState<S>
pub fn named(name: &str, editor: S) -> EditVecState<S>
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 as EditorState>::Context<'_>,
) -> Result<(), <S as EditorState>::Err>
pub fn edit_new( &mut self, row: usize, ctx: &<S as EditorState>::Context<'_>, ) -> Result<(), <S as EditorState>::Err>
Edit a new item inserted at the selected row.
Sourcepub fn edit(
&mut self,
row: usize,
ctx: &<S as EditorState>::Context<'_>,
) -> Result<(), <S as EditorState>::Err>
pub fn edit( &mut self, row: usize, ctx: &<S as EditorState>::Context<'_>, ) -> Result<(), <S as EditorState>::Err>
Edit the item at the selected row.
Sourcepub fn commit(
&mut self,
ctx: &<S as EditorState>::Context<'_>,
) -> Result<(), <S as EditorState>::Err>
pub fn commit( &mut self, ctx: &<S as EditorState>::Context<'_>, ) -> Result<(), <S as EditorState>::Err>
Commit the changes in the editor.
pub fn commit_and_append( &mut self, ctx: &<S as EditorState>::Context<'_>, ) -> Result<(), <S as EditorState>::Err>
pub fn commit_and_edit( &mut self, ctx: &<S as EditorState>::Context<'_>, ) -> Result<(), <S as EditorState>::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§fn default() -> EditVecState<S>
fn default() -> EditVecState<S>
Returns the “default value” for a type. Read more
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