TableNode<TRow>
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Node for rendering a table with columns, rows, and optional header/footer. Implements ILayoutProvider to clip scrollable content area.
public class TableNode<TRow> : Hex1bNode, ILayoutProvider, IDisposableInheritance
Object → Hex1bNode → TableNode<TRow>
Implements
Properties
ClipMode
The clip mode for this layout region.
Returns: ClipMode
public ClipMode ClipMode { get; }ClipRect
The clip rectangle for the scrollable content area.
Returns: Rect
public Rect ClipRect { get; }Data
The data source for table rows.
Returns: IReadOnlyList<<TRow>>
public IReadOnlyList<TRow>? Data { get; set; }DataSource
Async data source for virtualized tables. When set, Data property is ignored.
Returns: ITableDataSource<<TRow>>
public ITableDataSource<TRow>? DataSource { get; set; }DeselectAllCallback
Callback invoked when deselect all is triggered.
Returns: Action
public Action? DeselectAllCallback { get; set; }EmptyBuilder
Builder for empty state widget.
Returns: Func<RootContext, Hex1bWidget>
public Func<RootContext, Hex1bWidget>? EmptyBuilder { get; set; }FocusChangedHandler
Handler for focus changes.
Returns: Func<Object, Task>
public Func<object?, Task>? FocusChangedHandler { get; set; }FocusedKey
The key of the currently focused row.
Returns: Object
public object? FocusedKey { get; set; }FooterBuilder
Builder for footer cells.
Returns: Func<TableFooterContext, TableCell>>
public Func<TableFooterContext, IReadOnlyList<TableCell>>? FooterBuilder { get; set; }HeaderBuilder
Builder for header cells.
Returns: Func<TableHeaderContext, TableCell>>
public Func<TableHeaderContext, IReadOnlyList<TableCell>>? HeaderBuilder { get; set; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }IsFocused
Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).
Returns: Boolean
public override bool IsFocused { get; set; }IsScrollable
Whether the table content is scrollable (more rows than viewport).
Returns: Boolean
public bool IsScrollable { get; }IsSelectedSelector
Selector to determine if a row is selected (reads from view model).
Returns: Func<<TRow>, Boolean>
public Func<TRow, bool>? IsSelectedSelector { get; set; }MaxScrollOffset
The maximum scroll offset.
Returns: Int32
public int MaxScrollOffset { get; }ParentLayoutProvider
Parent layout provider for nested clipping.
Returns: ILayoutProvider
public ILayoutProvider? ParentLayoutProvider { get; set; }RenderMode
The render mode for the table (Compact or Full).
Returns: TableRenderMode
public TableRenderMode RenderMode { get; set; }RowActivatedHandler
Handler for row activation.
Returns: Func<Object, <TRow>, Task>
public Func<object, TRow, Task>? RowActivatedHandler { get; set; }RowBuilder
Builder for row cells. Receives row context, row data, and row state.
Returns: Func<TableRowContext, <TRow>, TableRowState, TableCell>>
public Func<TableRowContext, TRow, TableRowState, IReadOnlyList<TableCell>>? RowBuilder { get; set; }RowKeySelector
Selector function to extract a unique key from each row.
Returns: Func<<TRow>, Object>
public Func<TRow, object>? RowKeySelector { get; set; }ScrollOffset
The current scroll offset (first visible row index).
Returns: Int32
public int ScrollOffset { get; }SelectAllCallback
Callback invoked when select all is triggered.
Returns: Action
public Action? SelectAllCallback { get; set; }SelectionChangedCallback
Callback invoked when a row's selection state changes.
Returns: Action<<TRow>, Boolean>
public Action<TRow, bool>? SelectionChangedCallback { get; set; }ShowSelectionColumn
Whether to show a selection column with checkboxes.
Returns: Boolean
public bool ShowSelectionColumn { get; set; }ViewportRowCount
The number of rows visible in the viewport.
Returns: Int32
public int ViewportRowCount { get; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
rect(Rect):
protected override void ArrangeCore(Rect rect)ClipString(int, int, string)
Clips a string that starts at the given position, returning only the visible portion.
Parameters:
Returns: ValueTuple<Int32, String>
public (int adjustedX, string clippedText) ClipString(int x, int y, string text)ConfigureDefaultBindings(InputBindingsBuilder)
Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.
Parameters:
bindings(InputBindingsBuilder): The builder to add bindings to.
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)Dispose()
Disposes resources and unsubscribes from events.
public void Dispose()GetEffectiveData()
Gets the effective data to use, either from Data property or cached from DataSource.
Returns: IReadOnlyList<<TRow>>
public IReadOnlyList<TRow>? GetEffectiveData()GetEffectiveItemCount()
Gets the total item count, either from Data or cached from DataSource.
Returns: Int32
public int GetEffectiveItemCount()GetFocusableNodes()
Returns focusable nodes including this table and any focusable children in row cells.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()GetVisibleRowRange(int)
Gets the range of rows that should be materialized (visible + buffer).
Parameters:
totalRows(Int32): Total number of data rows.
Returns: ValueTuple<Int32, Int32>
Tuple of (startIndex, endIndex) for rows to materialize.
public (int Start, int End) GetVisibleRowRange(int totalRows)LoadDataAsync(int, int, CancellationToken)
Loads data from the async data source for the visible range. Called during reconciliation.
Parameters:
startIndex(Int32):count(Int32):cancellationToken(CancellationToken):
Returns: ValueTask
public ValueTask LoadDataAsync(int startIndex, int count, CancellationToken cancellationToken = default)MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)ShouldRenderAt(int, int)
Determines if a character at the given absolute position should be rendered.
Parameters:
Returns: Boolean
public bool ShouldRenderAt(int x, int y)