java.lang.Object
org.autogui.base.mapping.GuiReprValue
org.autogui.base.mapping.GuiReprValueLabel
- All Implemented Interfaces:
GuiRepresentation
a read-only text label for any type of object property
@GuiIncluded public Obj proLabel = new Obj(); public class Obj { //non GuiIncluded public String toString() {return "label-text";} }
-
Nested Class Summary
Nested classes/interfaces inherited from class org.autogui.base.mapping.GuiReprValue
GuiReprValue.NamedValue, GuiReprValue.ObjectSpecifier, GuiReprValue.ObjectSpecifierIndex, GuiReprValue.ObjectSpecifierNothing
Nested classes/interfaces inherited from interface org.autogui.base.mapping.GuiRepresentation
GuiRepresentation.GuiReprNone
-
Field Summary
Fields inherited from class org.autogui.base.mapping.GuiReprValue
NONE, NONE_WITH_CACHE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromJson
(GuiMappingContext context, Object target, Object json) create a new value object from the JSON with treating the target as an old value, or update the target with the JSON contents.boolean
toJson
(GuiMappingContext context, Object source) convert the source into JSON formattoUpdateValue
(GuiMappingContext context, Object newValue) called from a GUI element in order to update its value.Methods inherited from class org.autogui.base.mapping.GuiReprValue
addHistoryValue, castOrMake, checkAndUpdateSource, convertLog, createNewValue, errorWhileAddHistoryValue, fromSource, fromSourceUpdated, getNoneSupplier, getParentSource, getUpdatedSource, getUpdatedValue, getUpdatedValueWithoutNoUpdate, getValue, getValueCollectionElement, getValueCollectionSize, getValueType, getValueWithoutNoUpdate, isEditable, isFromJsonTakingMapWithContextNameEntry, isHistoryValueStored, isHistoryValueStored, isHistoryValueSupported, isUpdateContextSourceByUpdateFromGui, match, matchValueType, notifyUpdateWithParentSourceNone, setSource, toParentSource, toSource, toString, unwrapNoUpdate, update, updateCollectionElement, updateFromGui, updateWithParentSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.autogui.base.mapping.GuiRepresentation
continueCheckAndUpdateSourceForChildren, fromHumanReadableString, fromJsonWithNamed, isJsonSetter, isTaskRunnerUsedFor, matchAndSetNotifiersAsInit, setNotifiersTree, shutdown, toHumanReadableString, toJsonWithNamed, toStringHeader
-
Constructor Details
-
GuiReprValueLabel
public GuiReprValueLabel()
-
-
Method Details
-
toUpdateValue
Description copied from class:GuiReprValue
called from a GUI element in order to update its value. subclass can change to returned type and convert the value to the type. a typical use case is just down-casting and converting null to an empty object.- Overrides:
toUpdateValue
in classGuiReprValue
- Parameters:
context
- the context of the repr.newValue
- the current value- Returns:
- the updated value
-
toJson
Description copied from interface:GuiRepresentation
convert the source into JSON format- Specified by:
toJson
in interfaceGuiRepresentation
- Overrides:
toJson
in classGuiReprValue
- Parameters:
context
- a context holds the representationsource
- the converted object- Returns:
- always null
-
fromJson
Description copied from interface:GuiRepresentation
create a new value object from the JSON with treating the target as an old value, or update the target with the JSON contents. the behavior can be varied by each representation, confirmed byGuiRepresentation.isJsonSetter()
.- Specified by:
fromJson
in interfaceGuiRepresentation
- Overrides:
fromJson
in classGuiReprValue
- Parameters:
context
- a context of the repr.target
- a target objectjson
- json object, ignored- Returns:
- the target object
-
isHistoryValueSupported
public boolean isHistoryValueSupported()- Overrides:
isHistoryValueSupported
in classGuiReprValue
- Returns:
- if true,
GuiReprValue.updateFromGui(GuiMappingContext, Object, ObjectSpecifier, GuiTaskClock)
automatically add the value to the preferences. the default impl. returns true.
-