java.lang.Object
org.autogui.base.mapping.GuiReprValue
org.autogui.base.mapping.GuiReprObjectPane
- All Implemented Interfaces:
GuiRepresentation
- Direct Known Subclasses:
GuiReprObjectTabbedPane
an object representation composing member sub-representations
@GuiIncluded
public class C {
@GuiIncluded public String prop;
String v;
@GuiIncluded public String getValue() { return v; };
@GuiIncluded public void setValue(String v) { this.v = v; };
@GuiIncluded public void action() {...};
...
}
-
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 TypeMethodDescriptionfromHumanReadableString(GuiMappingContext context, String str) static ObjectfromHumanReadableStringToObject(GuiMappingContext context, String str) fromJson(GuiMappingContext context, Object target, Object json) static ObjectfromJsonToObject(GuiMappingContext context, Object target, Object json) constructing an object or setting up the target object from the JSON.static BiConsumer<GuiMappingContext, Object> static GuiReprValuebooleanisHistoryValueStored(Object value) booleanbooleanmatch(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 *protected booleanmatchWithoutSetting(GuiMappingContext context) static voidrunSubCollectionValue(GuiMappingContext subContext, Object source, BiConsumer<GuiMappingContext, Object> subAndNext) static voidrunSubPropertyValue(GuiMappingContext subContext, Object source, BiConsumer<GuiMappingContext, Object> subAndNext) voidshutdown(GuiMappingContext context, Object source) do shutting-down process if the target object is an AutoCloseable.static StringtoHumanReadableStringFromObject(GuiMappingContext context, Object source) constructing a human-readable string representation of the object.toHumanReadableStringTree(GuiMappingContext context, Object source) static GuiRepresentation.TreeStringtoHumanReadableStringTreeFromObject(GuiMappingContext context, Object source) toJson(GuiMappingContext context, Object source) static ObjecttoJsonFromObject(GuiMappingContext context, Object source) toString()static ObjectunwrapPropertyMap(GuiMappingContext s, Object subObj) 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, isHistoryValueSupported, isUpdateContextSourceByUpdateFromGui, matchValueType, notifyUpdateWithParentSourceNone, setSource, toParentSource, toSource, 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, fromJsonWithNamed, isJsonSetter, isTaskRunnerUsedFor, matchAndSetNotifiersAsInit, setNotifiersTree, toHumanReadableString, toJsonWithNamed, toStringHeader
-
Field Details
-
subRepresentation
-
-
Constructor Details
-
GuiReprObjectPane
-
GuiReprObjectPane
public GuiReprObjectPane()
-
-
Method Details
-
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
-
matchWithoutSetting
-
isHistoryValueSupported
public boolean isHistoryValueSupported()- Overrides:
isHistoryValueSupportedin classGuiReprValue- Returns:
- if true,
GuiReprValue.updateFromGui(GuiMappingContext, Object, ObjectSpecifier, GuiTaskClock)automatically add the value to the preferences. the default impl. returns true.
-
isHistoryValueStored
- Overrides:
isHistoryValueStoredin classGuiReprValue- Parameters:
value- the tested value, or null at loading- Returns:
- if true, actually the value is stored to the preferences store
-
toJson
- Specified by:
toJsonin interfaceGuiRepresentation- Overrides:
toJsonin classGuiReprValue- Parameters:
context- a context holds the representationsource- the converted object- Returns:
- Map: { propertyName: propertyJson }
-
toJsonFromObject
- Parameters:
context- the context of the caller's repr.source- the converted object- Returns:
- a map object (
LinkedHashMap), with entries based on the child contexts. a member is constructed withGuiRepresentation.toJsonWithNamed(GuiMappingContext, Object). Special case: if the map has only 1 collection entry, then it will return the entry value (list) instead of the map. This is because the entry name will be the type name and useless.
-
unwrapPropertyMap
-
fromJson
- Specified by:
fromJsonin interfaceGuiRepresentation- Overrides:
fromJsonin classGuiReprValue- Parameters:
context- a context holds the representationtarget- the target object or nulljson- the source JSON- Returns:
- the target or newly created object
-
fromJsonToObject
constructing an object or setting up the target object from the JSON. to set properties, it relies onGuiMappingContext.execute(Callable).- Parameters:
context- the context of the caller's reprtarget- the target object, may be null, and then it creates a new object by 0-args constructor of the value type of the representation (supposingGuiReprValue)json- the JSON object- Returns:
- the target or newly created object
-
getReprValue
-
toHumanReadableStringTree
public GuiRepresentation.TreeString toHumanReadableStringTree(GuiMappingContext context, Object source) - Parameters:
context- the context of the repr.source- converted to string- Returns:
- the representation of the source
-
toHumanReadableStringFromObject
constructing a human-readable string representation of the object. the contents consist of members of the object (listed by the context). each of them is processed byrunSubPropertyValue(GuiMappingContext, Object, BiConsumer)if it is a property. For obtaining the value of the property, it relies onGuiMappingContext.execute(Callable). if it is a collection element, then it will be processed byrunSubCollectionValue(GuiMappingContext, Object, BiConsumer).- Parameters:
context- the context associated with the caller's reprsource- the source object- Returns:
- the representation of the source
-
toHumanReadableStringTreeFromObject
public static GuiRepresentation.TreeString toHumanReadableStringTreeFromObject(GuiMappingContext context, Object source) - Parameters:
context- the object contextsource- the source object mapped by the context- Returns:
- a tree-string of source
- Since:
- 1.8
-
getAddingHumanReadableStringToList
public static BiConsumer<GuiMappingContext,Object> getAddingHumanReadableStringToList(List<GuiRepresentation.TreeString> list) -
runSubPropertyValue
public static void runSubPropertyValue(GuiMappingContext subContext, Object source, BiConsumer<GuiMappingContext, Object> subAndNext) -
runSubCollectionValue
public static void runSubCollectionValue(GuiMappingContext subContext, Object source, BiConsumer<GuiMappingContext, Object> subAndNext) -
fromHumanReadableString
-
fromHumanReadableStringToObject
-
shutdown
Description copied from interface:GuiRepresentationdo shutting-down process if the target object is an AutoCloseable.- Parameters:
context- the context of the repr.source- the target object, obtained from source value of the context
-
toString
- Overrides:
toStringin classGuiReprValue
-