TableView
classin packageklyn.gui.windows
public class TableView extends Container:
└ TableView

Spreadsheet-like table widget backed by a TableModel.

import klyn.gui.windows
import klyn.gui.windows.events

model = TableModel("users").addColumn("id").addColumn("login")
model.addRow(["1", "admin"])
table = TableView(model)
table.cellSelected += lambda(event: TableCellEvent): print(table.selectedValue)
Properties
Modifier and Type Member Description
public property editOnSingleClick
editOnSingleClick as Boolean = false
Starts editing an editable cell on the first primary-button click.
public readonly property isEditing
isEditing as Boolean:
Whether a cell currently owns the inline text editor.
public property model
model as TableModel:
Data model rendered by the view.
public property rowActionIcon
rowActionIcon as Icon = null
Icon displayed in each leading row-action cell.
public property rowActionToolTip
rowActionToolTip as String = "Row action"
Tooltip displayed while the pointer is over a row-action cell.
public property rowActionWidth
rowActionWidth as Int = 42
Width in pixels of the optional leading row-action column.
public property selectedColumn
selectedColumn as Int = -1
No summary.
public property selectedRow
selectedRow as Int = -1
No summary.
public readonly property selectedValue
selectedValue as String:
Text value of the selected cell, or an empty string when none is selected.
public property showRowActions
showRowActions as Boolean = false
Whether a compact action cell is displayed before each data row.
public property sortColumn
sortColumn as Int = -1
Column carrying the optional visual sort indicator, or -1.
public property sortDescending
sortDescending as Boolean = false
Whether the visual sort indicator points toward descending values.
Inherited Properties
propertyInherited Properties from Container: autoRelayout, childCount, layout, padding
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Events
Modifier and Type Member Description
public event cellEditFinished
cellEditFinished as TableCellEditEvent
Emitted after an inline cell edition has been accepted or rejected.
public event cellSelected
cellSelected as TableCellEvent
Emitted when the current cell changes by mouse or keyboard.
public event headerClicked
headerClicked as TableHeaderEvent
Emitted when a column header is clicked.
public event rowActionRequested
rowActionRequested as TableRowActionEvent
Emitted when the optional leading action cell of a row is clicked.
Inherited Events
eventInherited Events from Widget: focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public TableView
TableView(model as TableModel = null):
Creates a table view with an optional model.
Methods
Modifier and Type Member Description
public beginEdit
beginEdit(row as Int, column as Int) as Boolean:
Starts inline edition of an editable cell.
public cancelEdit
cancelEdit(restoreFocus as Boolean = true) as Void:
Cancels the current inline edition without updating the model.
public commitEdit
commitEdit() as Boolean:
Submits the current inline value to the table model.
public override paint
paint(painter as Painter) as Void:
No summary.
public override setBounds
setBounds(x as Int, y as Int, width as Int, height as Int) as Void:
No summary.
public setSelectedValue
setSelectedValue(value as String) as Boolean:
Updates the selected cell when the model is editable.
Inherited Methods
methodInherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operatorInherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: