TemplateListEditor

class TemplateListEditor(val originalTemplateList: TemplateList = Settings.DEFAULT.templateList, initialSelection: String? = null) : Disposable(source)

Component for editing a TemplateLists.

The editor essentially has a master-detail layout. On the left, a TemplateJTree shows all templates and the schemes contained within them, and on the right, a SchemeEditor for the currently-selected template or scheme is shown.

Parameters

initialSelection

the UUID of the scheme to select initially, or null or an invalid UUID to select the first template

See also

Constructors

Link copied to clipboard
constructor(originalTemplateList: TemplateList = Settings.DEFAULT.templateList, initialSelection: String? = null)

Types

Link copied to clipboard
object Companion

Holds constants.

Link copied to clipboard
private class ScrollOnFocusListener<S : Scheme>(val focusManager: KeyboardFocusManager, val editor: SchemeEditor<S>) : PropertyChangeListener, Disposable

Scrolls to the focused element within the editor, registering this listener with the focusManager, and automatically disposing itself when the editor is disposed.

Properties

Link copied to clipboard
Link copied to clipboard

The templates to edit.

Link copied to clipboard
Link copied to clipboard
val rootComponent: JPanel

The root component of the editor.

Link copied to clipboard
private var schemeEditor: SchemeEditor<*>?
Link copied to clipboard
private val schemeEditorPanel: JPanel
Link copied to clipboard

Functions

Link copied to clipboard
fun apply()

Saves the editor's state into originalTemplateList.

Link copied to clipboard
private fun createEditor(scheme: Scheme): SchemeEditor<out Scheme>

Creates an editor to edit scheme.

Link copied to clipboard
private fun createSplitter(): JBSplitter

Creates a new splitter.

Link copied to clipboard
open override fun dispose()

Disposes this editor's resources.

Link copied to clipboard
fun doValidate(): String?

Validates the state of the editor and indicates whether and why it is invalid.

Link copied to clipboard
fun isModified(): Boolean

Returns true if and only if the editor contains modifications relative to the last saved state.

Link copied to clipboard
private fun onTreeSelection()

Invoked when an entry is (de)selected in the tree.

Link copied to clipboard
fun reset()

Resets the editor's state to the last saved state.

Link copied to clipboard
fun selectScheme(scheme: Scheme)

Explicitly selects the given scheme (based on its UUID).