java.lang.Object
org.autogui.base.mapping.GuiReprValue
org.autogui.base.mapping.GuiReprPropertyPane
- All Implemented Interfaces:
GuiRepresentation
a property member definition: [propertyName: [ propertyValueField ] ].
the representation matches any context which has a property-member-type. However, value representations (string, file, enum, boolean and number) directly support the property-member-type and precedes this representation.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.autogui.base.mapping.GuiReprValue
GuiReprValue.NamedValue, GuiReprValue.ObjectSpecifier, GuiReprValue.ObjectSpecifierIndex, GuiReprValue.ObjectSpecifierNothingNested classes/interfaces inherited from interface org.autogui.base.mapping.GuiRepresentation
GuiRepresentation.GuiReprNone, GuiRepresentation.TreeString, GuiRepresentation.TreeStringComposite, GuiRepresentation.TreeStringValue -
Field Summary
FieldsFields inherited from class org.autogui.base.mapping.GuiReprValue
NONE, NONE_WITH_CACHE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateForContext(GuiMappingContext context) fromHumanReadableString(GuiMappingContext context, String str) fromJson(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.fromJsonProperty(GuiMappingContext context, Object target, Object json) fromJsonWithNamed(GuiMappingContext context, Object target, Object json) fromSource(Object o) booleanisEditableFromChild(GuiMappingContext context) booleanbooleanbooleanmatch(GuiMappingContext context) match the representation with the typeElement of the context, and if succeeded, it sets this representation to the context, and it might create sub-contexts for recursive matches *voidsetSubRepresentations(GuiRepresentation subRepresentations) toHumanReadableStringTree(GuiMappingContext context, Object source) toJson(GuiMappingContext context, Object source) convert the source into JSON formattoJsonProperty(GuiMappingContext context, Object source) toJsonWithNamed(GuiMappingContext context, Object source) the source might be aGuiReprValue.NamedValue, then it unwraps the named value, callsGuiRepresentation.toJson(GuiMappingContext, Object), and it returns Map with the name.toString()Methods inherited from class org.autogui.base.mapping.GuiReprValue
addHistoryValue, castOrMake, checkAndUpdateSource, convertLog, createNewValue, errorWhileAddHistoryValue, fromSourceUpdated, getNoneSupplier, getParentSource, getUpdatedSource, getUpdatedValue, getUpdatedValueWithoutNoUpdate, getValue, getValueCollectionElement, getValueCollectionSize, getValueType, getValueWithoutNoUpdate, isEditable, isHistoryValueStored, isHistoryValueStored, isHistoryValueSupported, isUpdateContextSourceByUpdateFromGui, matchValueType, notifyUpdateWithParentSourceNone, setSource, toParentSource, toUpdateValue, unwrapNoUpdate, update, updateCollectionElement, updateFromGui, updateWithParentSourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.autogui.base.mapping.GuiRepresentation
continueCheckAndUpdateSourceForChildren, isJsonSetter, isTaskRunnerUsedFor, matchAndSetNotifiersAsInit, setNotifiersTree, shutdown, toHumanReadableString, toStringHeader
-
Field Details
-
subRepresentations
-
-
Constructor Details
-
GuiReprPropertyPane
-
GuiReprPropertyPane
public GuiReprPropertyPane()
-
-
Method Details
-
setSubRepresentations
-
getSubRepresentations
-
match
Description copied from interface:GuiRepresentationmatch the representation with the typeElement of the context, and if succeeded, it sets this representation to the context, and it might create sub-contexts for recursive matches *- Specified by:
matchin interfaceGuiRepresentation- Overrides:
matchin classGuiReprValue- Parameters:
context- the context of the repr.- Returns:
- the matching result
-
toSource
- Overrides:
toSourcein classGuiReprValue- Parameters:
o- a wrapped object for clients of the representation- Returns:
- a raw-object which can be directly passed to type-element's executing methods
-
fromSource
- Overrides:
fromSourcein classGuiReprValue- Parameters:
o- a raw-object which can be directly passed to type-element's executing methods- Returns:
- a wrapped object for clients of the representation
-
createForContext
-
isEditableFromChild
-
toJsonWithNamed
Description copied from interface:GuiRepresentationthe source might be aGuiReprValue.NamedValue, then it unwraps the named value, callsGuiRepresentation.toJson(GuiMappingContext, Object), and it returns Map with the name. otherwise, it simply calls toJson and returns the result.- Parameters:
context- context of the repr.source- the source of returned JSON- Returns:
- JSON object
-
fromJsonWithNamed
- Parameters:
context- the context of the repr. In most cases, the type of the context will be a property.target- the target object. if it isGuiReprValue.NamedValue, then it obtains the value. nullablejson- aMapwith containing an entry for the name of the context- Returns:
- the returned value
GuiRepresentation.fromJson(GuiMappingContext, Object, Object). if the target is a NamedValue, the returned value will also be a NamedValue.
-
toJson
Description copied from interface:GuiRepresentationconvert the source into JSON format- Specified by:
toJsonin interfaceGuiRepresentation- Overrides:
toJsonin classGuiReprValue- Parameters:
context- a context holds the representationsource- the converted object- Returns:
- Map: { propertyName: propertyJson, ... }
-
toJsonProperty
-
fromJson
Description copied from interface:GuiRepresentationcreate 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:
fromJsonin interfaceGuiRepresentation- Overrides:
fromJsonin classGuiReprValue- Parameters:
context- the target contexttarget- the target value, which might be aGuiReprValue.NamedValueor the value of the property. Note: the target is not a property owner object.json- aMapjson- Returns:
- the property value or a
GuiReprValue.NamedValueif the target is also the one.
-
fromJsonProperty
-
isFromJsonTakingMapWithContextNameEntry
- Overrides:
isFromJsonTakingMapWithContextNameEntryin classGuiReprValue- Parameters:
context- the target context- Returns:
- true means
GuiReprValue.fromJson(GuiMappingContext, Object, Object)takes a map with the entry namedGuiMappingContext.getName()
-
toHumanReadableStringTree
public GuiRepresentation.TreeString toHumanReadableStringTree(GuiMappingContext context, Object source) - Parameters:
context- the context of the reprsource- convert to string- Returns:
- tree string of source, can be encoded by
Object.toString()(used byGuiRepresentation.toHumanReadableString(GuiMappingContext, Object)
-
fromHumanReadableString
-
isHistoryValueSupported
public boolean isHistoryValueSupported()- Overrides:
isHistoryValueSupportedin classGuiReprValue- Returns:
- false: a property does not support history values, but the content repr. might support it.
-
toString
- Overrides:
toStringin classGuiReprValue
-