intellij-randomness / com.fwdekker.randomness.ui / ActivityTableModelEditor

ActivityTableModelEditor

abstract class ActivityTableModelEditor<T> : TableModelEditor<EditableDatum<T>>

A table that associates a certain data type with a checkbox.

Parameters

T - the data type

columns - the columns of the table, excluding the activity column

itemEditor - describes what happens when a row is edited

emptyText - the text to display when the table is empty

emptySubText - the instruction to display when the table is empty

isCopyable - returns true if and only if the given datum can be copied

columnAdjuster - invoked on the list of columns (including the activity column) to allow adjusting their properties

Constructors

<init>

ActivityTableModelEditor(columns: Array<ColumnInfo<EditableDatum<T>, *>>, itemEditor: CollectionItemEditor<EditableDatum<T>>, emptyText: String, emptySubText: String, isCopyable: (T) -> Boolean = { true }, columnAdjuster: (List<TableColumn>) -> Unit = {})

A table that associates a certain data type with a checkbox.

Properties

activeData

var activeData: Collection<T>

All data of which the checkbox is currently checked.

data

var data: Collection<T>

All data currently in the table.

panel

val panel: JPanel

The panel in which the table editor is present.

Functions

addChangeListener

fun addChangeListener(listener: () -> Unit): Unit

Adds a listener that is called whenever this table is updated.

createComponent

fun createComponent(): JPanel

Creates a new JPanel with the table and the corresponding buttons.

Companion Object Properties

DEFAULT_STATE

const val DEFAULT_STATE: Boolean

Whether newly added data are active by default.

Inheritors

DictionaryTable

class DictionaryTable : ActivityTableModelEditor<DictionaryReference>

An editable table for selecting and editing Dictionaries.

SymbolSetTable

class SymbolSetTable : ActivityTableModelEditor<SymbolSet>

An editable table for selecting and editing SymbolSets.