pub struct SelectEditor { /* private fields */ }Expand description
Edits a cell with one value of a closed set, picked from a searchable list under the cell.
The list opens at once with the cell’s value picked. Typing searches,
↑ and ↓ pick, Enter and a click commit the picked value, Tab commits it
and moves on, Escape cancels. Typing on the cell starts the search with
the typed text; Backspace and Delete pick the empty item
(Self::with_empty), or take no edit without one.
Implementations§
Source§impl SelectEditor
impl SelectEditor
Sourcepub fn new(options: impl IntoIterator<Item = SelectOption>) -> Self
pub fn new(options: impl IntoIterator<Item = SelectOption>) -> Self
A list of options, in their order.
Sourcepub fn with_empty(self, label: impl Into<SharedString>) -> Self
pub fn with_empty(self, label: impl Into<SharedString>) -> Self
Adds an item on top that commits Empty, shown as label.
Sourcepub fn options(&self) -> &[SelectOption]
pub fn options(&self) -> &[SelectOption]
The options, without the empty item.
Sourcepub fn empty_label(&self) -> Option<&SharedString>
pub fn empty_label(&self) -> Option<&SharedString>
The label of the empty item, if there is one.
Trait Implementations§
Source§impl<R: GridRow> CellEditor<R> for SelectEditor
impl<R: GridRow> CellEditor<R> for SelectEditor
Source§fn open(
&self,
start: &EditorStart<'_, R>,
window: &mut Window,
cx: &mut App,
) -> EditorOpen
fn open( &self, start: &EditorStart<'_, R>, window: &mut Window, cx: &mut App, ) -> EditorOpen
What to do with a start: open a field, commit at once, or refuse.
Source§impl Clone for SelectEditor
impl Clone for SelectEditor
Source§fn clone(&self) -> SelectEditor
fn clone(&self) -> SelectEditor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SelectEditor
impl !RefUnwindSafe for SelectEditor
impl Send for SelectEditor
impl Sync for SelectEditor
impl Unpin for SelectEditor
impl UnsafeUnpin for SelectEditor
impl !UnwindSafe for SelectEditor
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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