java.lang.Object
org.autogui.base.mapping.GuiReprAction
- All Implemented Interfaces:
GuiRepresentation
The abstract action component for an action
@GuiIncluded public class C { ... @GuiIncluded public void action() { ... } }an action can be selection-updater by attaching
GuiListSelectionUpdater
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.autogui.base.mapping.GuiRepresentation
GuiRepresentation.GuiReprNone
-
Field Summary
Fields inherited from interface org.autogui.base.mapping.GuiRepresentation
NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAndUpdateSource
(GuiMappingContext context) invoke the associated method and check the returned value whether it is updated or not.executeAction
(GuiMappingContext context, GuiReprValue.ObjectSpecifier targetSpecifier) the action executor relying onGuiMappingContext.execute(Callable)
.executeActionForTargets
(GuiMappingContext context, List<?> targets) the action executor relying onGuiMappingContext.execute(Callable)
.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.boolean
isSelectionAction
(GuiMappingContext context) boolean
isSelectionChangeAction
(GuiMappingContext context, GuiMappingContext tableContext) boolean
isSelectionChangeRowAndColumnIndicesAction
(GuiMappingContext context, GuiMappingContext tableContext) checking an action can be a selection updater for a tableboolean
isSelectionChangeRowIndicesAction
(GuiMappingContext context, GuiMappingContext tableContext) checking an action can be a selection updater for a tableboolean
match
(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 *toJson
(GuiMappingContext context, Object source) convert the source into JSON formattoString()
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
-
GuiReprAction
public GuiReprAction()
-
-
Method Details
-
match
Description copied from interface:GuiRepresentation
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 *- Specified by:
match
in interfaceGuiRepresentation
- Parameters:
context
- the context of the repr.- Returns:
- the matching result
-
checkAndUpdateSource
Description copied from interface:GuiRepresentation
invoke the associated method and check the returned value whether it is updated or not. if updated, set the source of context to the value. This is non-recursive operation;GuiMappingContext
recursively calls this method. The source of parent is already updated by the order of the calls.- Specified by:
checkAndUpdateSource
in interfaceGuiRepresentation
- Parameters:
context
- the context of the repr.- Returns:
- the representation is updated or not
-
executeAction
public Object executeAction(GuiMappingContext context, GuiReprValue.ObjectSpecifier targetSpecifier) the action executor relying onGuiMappingContext.execute(Callable)
. the target is obtained from the parent context- Parameters:
context
- the contexttargetSpecifier
- the specifier of the target- Returns:
- result of method execution or null
-
executeActionForTargets
the action executor relying onGuiMappingContext.execute(Callable)
.- Parameters:
context
- the contexttargets
- the targets- Returns:
- results of each execution, might include null elements. if some execution cause an exception, partially constructed results will be returned
-
toJson
Description copied from interface:GuiRepresentation
convert the source into JSON format -
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
- Parameters:
context
- a context holds the representationtarget
- the target object or nulljson
- JSON objects representing the targetString
,Number
,Boolean
,List
,Map
or null- Returns:
- created object from the json, target if provided, or null.
-
isSelectionAction
- Parameters:
context
- the context of the action- Returns:
- true if the target method has the annotation GuiListSelectionCallback
-
toString
-
isSelectionChangeAction
- Parameters:
context
- the context of the actiontableContext
- the table context in order to obtain the element-type of the list- Returns:
- the target method returns a list of the element-type List<E> and has the annotation GuiListSelectionUpdater
-
isSelectionChangeRowIndicesAction
public boolean isSelectionChangeRowIndicesAction(GuiMappingContext context, GuiMappingContext tableContext) checking an action can be a selection updater for a table- Parameters:
context
- the action contexttableContext
- the linked table-context- Returns:
- true if the target action returning
List<Integer>
withGuiListSelectionUpdater.index()
=true and the parent of tableContext is target of the action (specified byGuiListSelectionUpdater.target()
or the method name "select...") - Since:
- 1.5
-
isSelectionChangeRowAndColumnIndicesAction
public boolean isSelectionChangeRowAndColumnIndicesAction(GuiMappingContext context, GuiMappingContext tableContext) checking an action can be a selection updater for a table- Parameters:
context
- the action contexttableContext
- the linked table-context- Returns:
- true if the target action returning
List<int[]>
withGuiListSelectionUpdater
withindex=true
, and the parent of tableContext is target of the action (specified byGuiListSelectionUpdater.target()
or the method name "select...") - Since:
- 1.5
-