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

JEditableList

class JEditableList<T> : JTable

A JList in which each entry has a JCheckBox in front of it.

Parameters

name - the name of this component

Parameters

Constructors

<init>

JEditableList(name: String? = null)

A JList in which each entry has a JCheckBox in front of it.

Properties

activeEntries

val activeEntries: List<T>

Returns all entries of which the checkbox is checked.

entries

val entries: List<T>

Returns a list of all entries.

entryCount

val entryCount: Int

Returns the number of entries in the list.

highlightedEntry

val highlightedEntry: T?

Returns the entry that is currently selected by the user, if there is one.

Functions

addEntry

fun addEntry(entry: T): Unit

Adds an entry to the list.

addEntryActivityChangeListener

fun addEntryActivityChangeListener(listener: EntryActivityChangeListener): Unit

Adds a listener that is called when a row's activity is changed by the user.

clear

fun clear(): Unit

Removes all entries.

getColumnClass

fun getColumnClass(column: Int): Class<out Any>

Returns the class of the data in the column with index column.

getEntry

fun getEntry(row: Int): T

Returns the entry in the given row.

isActive

fun isActive(entry: T): Boolean

Returns true iff the given entry's checkbox is checked.

isCellEditable

fun isCellEditable(row: Int, column: Int): Boolean

Returns true iff column is 0.

removeEntry

fun removeEntry(entry: T): Unit

Removes the given entry and its checkbox.

removeEntryActivityChangeListener

fun removeEntryActivityChangeListener(listener: EntryActivityChangeListener): Unit

Removes a listener that was called when a row's activity was changed by the user.

setActiveEntries

fun setActiveEntries(entries: Collection<T>): Unit

Checks the checkboxes of all given entries, and unchecks all other checkboxes.

setEntries

fun setEntries(entries: Collection<T>): Unit

Removes all current entries, and adds the given entries.

setEntryActivity

fun setEntryActivity(entry: T, activity: Boolean): Unit

Sets the activity of the given entry.