Package com.simsilica.lemur
Interface ValueEditor<T>
- All Superinterfaces:
VersionedObject<T>
- All Known Implementing Classes:
TextFieldValueEditor
Provides an appropriate editor element to edit a particular
type of value. For a ValueEditor instance, only one edited
value will be active at a time so this has a different modal
life cycle than ValueRenderer. (For example, a table may
reuse the ValueRenderer for every value in a column while
there will only ever be one ValueEditor active at any time.)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureStyle
(ElementId elementId, String style) Called by the using component to set the preferred ElementId and style for the editor.Returns the GUI element that is providing editing support.Returns the current committed value of the editor.boolean
isActive()
Returns true if this editor is still active.void
Sets the initial value of the object to be edited.startEditing
(T initialValue) Starts editing and returns the Panel that should be added to the parent to facilitate that editing.boolean
updateState
(float tpf) Called to update the state of the editor and returns true or false if editing should continue.Methods inherited from interface com.simsilica.lemur.core.VersionedObject
createReference, getVersion
-
Method Details
-
setObject
Sets the initial value of the object to be edited. -
getObject
T getObject()Returns the current committed value of the editor. If the editor holds-and-modifies that value then this will return the unedited value until editing is complete. If the editor is a 'live' editor then this will always return the current value. The versioned reference for this editor can be used to watch for value changes.- Specified by:
getObject
in interfaceVersionedObject<T>
-
updateState
boolean updateState(float tpf) Called to update the state of the editor and returns true or false if editing should continue. This should be called once per frame as part of the parent's own updates. -
isActive
boolean isActive()Returns true if this editor is still active. -
configureStyle
Called by the using component to set the preferred ElementId and style for the editor. Implementations can ignore this if they wish to override the default element ID or style. -
startEditing
Starts editing and returns the Panel that should be added to the parent to facilitate that editing. -
getEditor
Panel getEditor()Returns the GUI element that is providing editing support.
-