java.lang.Object
org.autogui.base.mapping.GuiReprValue
org.autogui.base.mapping.GuiReprValueEnumComboBox
- All Implemented Interfaces:
GuiRepresentation
a combo-box component for an
Enum property
@GuiIncluded public EnumVal prop;
public enum EnumVal {...}
-
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) 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.getDisplayName(GuiMappingContext context, Enum<?> enumValue) Object[]getEnumConstants(GuiMappingContext context) getEnumValue(GuiMappingContext context, String nameOrIndex) booleanbooleanmatchValueType(Class<?> cls) toHumanReadableStringTree(GuiMappingContext context, Object source) toJson(GuiMappingContext context, Object source) convert the source into JSON formatMethods 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, isHistoryValueSupported, isUpdateContextSourceByUpdateFromGui, match, notifyUpdateWithParentSourceNone, setSource, toParentSource, toSource, toString, 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, isTaskRunnerUsedFor, matchAndSetNotifiersAsInit, setNotifiersTree, shutdown, toHumanReadableString, toJsonWithNamed, toStringHeader
-
Field Details
-
numPattern
-
-
Constructor Details
-
GuiReprValueEnumComboBox
public GuiReprValueEnumComboBox()
-
-
Method Details
-
matchValueType
- Overrides:
matchValueTypein classGuiReprValue
-
getDisplayName
-
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:
- a name of a
Enummember
-
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 context of the repr.target- unusedjson- aStringas a name of a member of an enum.- Returns:
- an
Enummember of the name
-
toHumanReadableStringTree
public GuiRepresentation.TreeString toHumanReadableStringTree(GuiMappingContext context, Object source) - Parameters:
context- the context of the repr.source- converted to string- Returns:
- a name of a
Enummember
-
fromHumanReadableString
- Parameters:
context- the context of the repr.str- the source str: name of a member- Returns:
- an
Enummember of the name
-
isJsonSetter
public boolean isJsonSetter()- Returns:
- true means
GuiRepresentation.fromJson(GuiMappingContext, Object, Object)takes a target object and set json properties to the target. otherwise, the method will return a new value, thus the target can be null
-
getEnumConstants
-
getEnumValue
- Parameters:
context- the context which is used for obtaining the type of the enum.nameOrIndex-Enum.name()orEnum.ordinal()- Returns:
- an Enum member or null if not found
-