pub trait Tab {
type AppState;
Show 35 methods
// Required methods
fn widgets(
&mut self,
area: Rect,
) -> Vec<(&mut dyn Widget<AppData = Self::AppState>, Rect)>;
fn tabdata(&mut self) -> &mut TabData<Self::AppState>;
fn tabdata_ref(&self) -> &TabData<Self::AppState>;
fn title(&self) -> &str;
// Provided methods
fn remove_popup_hook(&mut self) { ... }
fn resolve_tab(&mut self, value: Box<dyn Any>) { ... }
fn exit_tab(&mut self) { ... }
fn set_popup(&mut self, pop: Box<dyn Tab<AppState = Self::AppState>>) { ... }
fn set_popup_with_modifier(
&mut self,
pop: Box<dyn Tab<AppState = Self::AppState>>,
f: Box<dyn FnMut(&Box<dyn Any>)>,
) { ... }
fn move_to_widget(&mut self, w: &dyn Widget<AppData = Self::AppState>) { ... }
fn move_to_id(&mut self, id: &str) { ... }
fn move_to_area(&mut self, area: Rect) { ... }
fn handle_popup_value(
&mut self,
_app_data: &mut Self::AppState,
_return_value: Box<dyn Any>,
) { ... }
fn tab_keyhandler_deselected(
&mut self,
_app_data: &mut Self::AppState,
_key: KeyEvent,
) -> bool { ... }
fn tab_keyhandler_selected(
&mut self,
_app_data: &mut Self::AppState,
_key: KeyEvent,
) -> bool { ... }
fn is_selected(&self, w: &dyn Widget<AppData = Self::AppState>) -> bool { ... }
fn pre_render_hook(&mut self, _app_data: &mut Self::AppState) { ... }
fn render(
&mut self,
f: &mut Frame<'_>,
app_data: &mut Self::AppState,
area: Rect,
) { ... }
fn after_keyhandler(&mut self, _app_data: &mut Self::AppState) { ... }
fn pop_up(&mut self) -> Option<&mut Box<dyn Tab<AppState = Self::AppState>>> { ... }
fn get_popup_value(&mut self) -> Option<&mut PopUpState> { ... }
fn popup_state(&mut self) -> &mut PopUpState { ... }
fn validate_pos(&mut self, area: Rect) { ... }
fn remove_popup(&mut self) { ... }
fn check_popup_value(&mut self, app_data: &mut Self::AppState) { ... }
fn pre_keyhandler_hook(&mut self, _key: KeyEvent) { ... }
fn entry_keyhandler(
&mut self,
event: Event,
app_data: &mut Self::AppState,
area: Rect,
) { ... }
fn tab_keyhandler(
&mut self,
app_data: &mut Self::AppState,
key: KeyEvent,
) -> bool { ... }
fn widget_keyhandler(
&mut self,
app_data: &mut Self::AppState,
key: KeyEvent,
area: Rect,
) { ... }
fn set_map(&mut self, area: Rect) { ... }
fn entry_render(
&mut self,
f: &mut Frame<'_>,
app_data: &mut Self::AppState,
area: Rect,
) { ... }
fn should_exit(&mut self) -> bool { ... }
fn cursor(&mut self) -> Pos { ... }
fn selected(&mut self) -> bool { ... }
fn navigate(&mut self, dir: Retning) { ... }
}Required Associated Types§
Required Methods§
fn widgets( &mut self, area: Rect, ) -> Vec<(&mut dyn Widget<AppData = Self::AppState>, Rect)>
fn tabdata(&mut self) -> &mut TabData<Self::AppState>
fn tabdata_ref(&self) -> &TabData<Self::AppState>
fn title(&self) -> &str
Provided Methods§
fn remove_popup_hook(&mut self)
fn resolve_tab(&mut self, value: Box<dyn Any>)
fn exit_tab(&mut self)
fn set_popup(&mut self, pop: Box<dyn Tab<AppState = Self::AppState>>)
fn set_popup_with_modifier( &mut self, pop: Box<dyn Tab<AppState = Self::AppState>>, f: Box<dyn FnMut(&Box<dyn Any>)>, )
fn move_to_widget(&mut self, w: &dyn Widget<AppData = Self::AppState>)
fn move_to_id(&mut self, id: &str)
fn move_to_area(&mut self, area: Rect)
fn handle_popup_value( &mut self, _app_data: &mut Self::AppState, _return_value: Box<dyn Any>, )
Sourcefn tab_keyhandler_deselected(
&mut self,
_app_data: &mut Self::AppState,
_key: KeyEvent,
) -> bool
fn tab_keyhandler_deselected( &mut self, _app_data: &mut Self::AppState, _key: KeyEvent, ) -> bool
Keyhandler stuff that should run if no widgets are selected.
Sourcefn tab_keyhandler_selected(
&mut self,
_app_data: &mut Self::AppState,
_key: KeyEvent,
) -> bool
fn tab_keyhandler_selected( &mut self, _app_data: &mut Self::AppState, _key: KeyEvent, ) -> bool
Keyhandler stuff that should run if a widget is selected. Think of this as widget specific stuff that requires the state of the tab, and therefore the logic cannot be handled by the widget directly.
fn is_selected(&self, w: &dyn Widget<AppData = Self::AppState>) -> bool
fn pre_render_hook(&mut self, _app_data: &mut Self::AppState)
fn render( &mut self, f: &mut Frame<'_>, app_data: &mut Self::AppState, area: Rect, )
fn after_keyhandler(&mut self, _app_data: &mut Self::AppState)
fn pop_up(&mut self) -> Option<&mut Box<dyn Tab<AppState = Self::AppState>>>
fn get_popup_value(&mut self) -> Option<&mut PopUpState>
fn popup_state(&mut self) -> &mut PopUpState
fn validate_pos(&mut self, area: Rect)
Sourcefn remove_popup(&mut self)
fn remove_popup(&mut self)
its a function so that it can be overriden if needed.