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

Constructors

<init>

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

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.

emptySubText

val emptySubText: String

the instruction to display when the table is empty

Functions

addChangeListener

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

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

createComponent

open 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<Dictionary>

An editable table for selecting and editing Dictionaries.

SymbolSetTable

class SymbolSetTable : ActivityTableModelEditor<SymbolSet>

An editable table for selecting and editing SymbolSets.