TableModel
class in package klyn.gui.windows

    public class TableModel:

TableModel

Simple tabular data model consumed by `TableView`.

The model intentionally stores strings because it is the generic visual layer. Database-specific adapters can subclass or populate it from typed records before handing it to the widget.

    model = TableModel("users")
    model.addColumn("id").addColumn("login")
    model.addRow(["1", "admin"])
    table = TableView(model)

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | columns `columns as ArrayList<String>` | Column labels in display order.
public property | isReadOnly `isReadOnly as Boolean` | Whether UI editors must prevent cell updates.
public property | name `name as String` | Model display name.
public property | rows `rows as ArrayList<ArrayList<String>>` | Row values, one string list per row.

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | TableModel `TableModel(name as String, readOnly as Boolean = false):` | Creates an empty table model.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | addColumn `addColumn(name as String) as TableModel:` | Appends a column and returns this model for fluent setup.
public | addRow `addRow(values as ArrayList<String>) as TableModel:` | Appends a row and returns this model for fluent setup.
public | cell `cell(row as Int, column as Int) as String:` | Returns a cell value or an empty string when the coordinates are invalid.
public | setCell `setCell(row as Int, column as Int, value as String) as Boolean:` | Updates a cell when the model is editable.