java.lang.Object
org.autogui.swing.prefs.GuiSwingPrefsHistoryValues
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
result componentstatic class
static class
static class
static class
static class
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateHistory
(GuiPreferences.HistoryValueEntry entry, GuiPreferences prefs) createHistoryImagePrefs
(Object value) createHistoryObjectPrefs
(Object value, GuiPreferences prefs, boolean setCurrentValue) createJsonEntrySource
(Supplier<Object> source, Consumer<Object> updater) creates a small pane of JSON editor.createJsonEntrySource
(GuiPreferences prefs, Supplier<? extends GuiSwingPrefsSupports.PreferencesByJsonEntry> prefsFactory) createObjectComponent
(Object value, GuiTypeElement type) wraps the value byGuiSwingPrefsHistoryValues.ValueHolder
and creates a GUI component for the value-holder with the type.createObjectComponent
(GuiMappingContext context) createObjectSimpleType
(Object value, Class<?> type) static DefaultMutableTreeNode
createTreeNodeJson
(String key, Object v)
-
Field Details
-
typeBuilder
-
-
Constructor Details
-
GuiSwingPrefsHistoryValues
public GuiSwingPrefsHistoryValues()
-
-
Method Details
-
typeBuilder
-
createHistory
public GuiSwingPrefsHistoryValues.HistoryPaneResult createHistory(GuiPreferences.HistoryValueEntry entry, GuiPreferences prefs) -
createHistoryObjectPrefs
public GuiSwingPrefsHistoryValues.HistoryPaneResult createHistoryObjectPrefs(Object value, GuiPreferences prefs, boolean setCurrentValue) -
createObjectSimpleType
public GuiSwingPrefsHistoryValues.HistoryPaneResult createObjectSimpleType(Object value, Class<?> type) -
createHistoryImagePrefs
-
createObjectComponent
public GuiSwingPrefsHistoryValues.HistoryPaneResult createObjectComponent(Object value, GuiTypeElement type) wraps the value byGuiSwingPrefsHistoryValues.ValueHolder
and creates a GUI component for the value-holder with the type. The returned result can update the value by updatingGuiPreferences.HistoryValueEntry
;GuiSwingPrefsHistoryValues.HistoryPaneResult.withEntry(GuiPreferences.HistoryValueEntry)
can update the value-holder and the GUI component.GuiSwingPrefsHistoryValues.HistoryPaneResult.withGuiToSourceUpdater(Consumer)
can supply a callback of the value update by the GUI component.- Parameters:
value
- a valuetype
- the type of the value- Returns:
- GUI component for the value
-
createObjectComponent
public GuiSwingPrefsHistoryValues.HistoryPaneResult createObjectComponent(GuiMappingContext context) -
createValue
-
createTreeJson
-
createJsonEntrySourceForCurrentValue
public GuiSwingPrefsHistoryValues.HistoryPaneResult createJsonEntrySourceForCurrentValue(GuiPreferences prefs) -
createJsonEntrySource
public GuiSwingPrefsHistoryValues.HistoryPaneResult createJsonEntrySource(GuiPreferences prefs, Supplier<? extends GuiSwingPrefsSupports.PreferencesByJsonEntry> prefsFactory) - Parameters:
prefs
- the sprefs of the source used asGuiSwingPrefsSupports.PreferencesByJsonEntry.loadFromAndToJson(GuiPreferences)
andGuiSwingPrefsSupports.PreferencesByJsonEntry.setJsonAndSaveTo(Object, GuiPreferences)
prefsFactory
- a constructor for creating temporarry object- Returns:
- a pane containing JSON source editor
- See Also:
-
createJsonEntrySource
public static GuiSwingPrefsHistoryValues.HistoryPaneResult createJsonEntrySource(Supplier<Object> source, Consumer<Object> updater) creates a small pane of JSON editor. The retruned pane contains a tool-bar with the "Reset" button, and the editor-pane with a scroll-pane.GuiSwingPrefsHistoryValues.HistoryPaneResult.updateLastEntrySource()
will reload and set the text from the given JSON getter; Note it does not have HistoryValueEntry, but it overides the method with updating the text-pane.- Parameters:
source
- the source getter of a JSON object (do not get called often)updater
- the source setter of a JSON object (immediately called each edits)- Returns:
- a pane containg a text-pane for editing JSON source.
-
createTreeNodeJson
-