use egui::{Color32, Id, Ui};
use egui_extras::Column as TableColumnConfig;
use tabular_core::{CellCoord, ColumnUid};
pub trait TableFrontend {
fn show_cell_view(&mut self, coord: CellCoord, ui: &mut Ui, id: Id);
fn show_cell_editor(
&mut self,
coord: CellCoord,
ui: &mut Ui,
id: Id,
) -> Option<egui::Response> {
let (_, _, _) = (coord, ui, id);
None
}
fn cancel_edit(&mut self) {}
fn column_render_config(&mut self, col_uid: ColumnUid) -> TableColumnConfig {
let _ = col_uid;
TableColumnConfig::auto().resizable(true)
}
fn on_cell_view_response(&mut self, coord: CellCoord, resp: &egui::Response) -> Option<()> {
let _ = (coord, resp);
None
}
fn custom_column_ui(&mut self, _col_uid: ColumnUid, _ui: &mut Ui, _id: Id) {}
fn cell_color(&self, _coord: CellCoord) -> Option<Color32> {
None
}
fn cell_tooltips(&self, _coord: CellCoord) -> Vec<&str> {
vec![]
}
fn cell_corner(&self, _coord: CellCoord) -> Option<Color32> {
None
}
}