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

PreviewPanel

class PreviewPanel<T : DataInsertAction>

A panel that shows a preview of the values generated by a DataInsertAction.

Generates a random value that the given DataInsertAction could generate as a preview to the user. By reusing the same seed, the generated value remains (approximately) the same and the user can easily see the effect of their changes. After registering some components with this panel, the preview will be updated whenever those components are updated.

Parameters

T - the type of DataInsertAction

Constructors

<init>

PreviewPanel(getGenerator: () -> T)

A panel that shows a preview of the values generated by a DataInsertAction.

Properties

rootPane

lateinit var rootPane: JPanel

The root panel containing the preview elements.

Functions

updatePreview

fun updatePreview(): Unit

Updates the preview with the current settings.

updatePreviewOnUpdateOf

fun updatePreviewOnUpdateOf(vararg components: Any): Unit

Adds listeners to the given components so that this preview is updated whenever the given components are updated.