intellij-randomness / com.fwdekker.randomness / SchemesPanel

SchemesPanel

abstract class SchemesPanel<T : Scheme<T>> : SimpleSchemesPanel<T>, SchemesModel<T>

A panel to manage schemes with, providing a dropdown box to select schemes from and buttons to remove, rename, etc. schemes.

Parameters

T - the type of scheme to manage

Types

Listener

interface Listener<T : Scheme<T>>

A listener that listens to events that occur to this panel.

SchemeActions

inner class SchemeActions<T : Scheme<T>> : AbstractSchemeActions<T>

The actions that can be performed with this panel.

Constructors

<init>

SchemesPanel(settings: Settings<*, T>)

A panel to manage schemes with, providing a dropdown box to select schemes from and buttons to remove, rename, etc. schemes.

Properties

actions

val actions: SchemesPanel.SchemeActions<T>

Actions that can be performed with this panel.

settings

val settings: Settings<*, T>

the settings model that backs this panel; changes made through this panel are reflected in the given settings instance

type

abstract val type: Class<T>

The type of scheme being managed.

Functions

addListener

fun addListener(listener: SchemesPanel.Listener<T>): Boolean

Registers a listener that will be informed whenever the scheme selection changed.

canDeleteScheme

open fun canDeleteScheme(scheme: T): Boolean

Returns true if the given scheme can be deleted.

canDuplicateScheme

open fun canDuplicateScheme(scheme: T): Boolean

Returns true because all schemes can be duplicated.

canRenameScheme

open fun canRenameScheme(scheme: T): Boolean

Returns true if the given scheme can be renamed.

canResetScheme

open fun canResetScheme(scheme: T): Boolean

Returns true if the given scheme can be reset.

containsScheme

open fun containsScheme(name: String, projectScheme: Boolean): Boolean

Returns true if a scheme with the given name is present in this panel.

createDefaultInstances

abstract fun createDefaultInstances(): List<T>

Returns a list of the default instances.

createSchemeActions

fun createSchemeActions(): SchemesPanel.SchemeActions<T>

Returns an object with a number of actions that can be performed on this panel.

differsFromDefault

open fun differsFromDefault(scheme: T): Boolean

Returns true if the given scheme is the default scheme.

getModel

open fun getModel(): SchemesPanel<T>

Returns this panel, because this panel also functions as the model.

getScheme

fun getScheme(name: String): T

Returns the scheme with the given name.

highlightNonDefaultSchemes

open fun highlightNonDefaultSchemes(): Boolean

Returns true so that non-default schemes are highlighted.

isProjectScheme

open fun isProjectScheme(scheme: T): Boolean

Returns false because project-specific schemes are not supported.

removeScheme

open fun removeScheme(scheme: T): Unit

Removes the given scheme from the settings.

supportsProjectSchemes

open fun supportsProjectSchemes(): Boolean

Returns false because project-specific schemes are not supported.

updateComboBoxList

fun updateComboBoxList(): Unit

Forcefully updates the combo box so that its entries and the current selection reflect the settings instance.

useBoldForNonRemovableSchemes

open fun useBoldForNonRemovableSchemes(): Boolean

Returns true so that non-removable schemes are highlighted.