Package com.xpdustry.distributor.api.gui
Interface Action
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A function that is executed when an interaction occurs in a gui.
-
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes the action.static ActionReturns an action mapping the viewer to anAudience.static Actionback()Returns an action that goes back to the previous window.static Actionback(int depth) Returns an action that goes back to the window at the given depth.static ActionReturns an action that invoke a command for the viewer.static <T> ActionReturns an action that computes a state entry if it exists.static <T> ActionReturns an action that computes a state entry.static ActionhideAll()Returns an action that hides all windows in the hierarchy.static Actionnone()Returns an action that does nothing.static ActionReturns an action that runs the given runnable.default ActionReturns a new action that first executes this action and then the given action.static <T> ActionReturns an action that sets a state entry with the given value.static ActionReturns an action that removes a state entry.
-
Method Details
-
none
Returns an action that does nothing. -
with
Returns an action that sets a state entry with the given value.- Type Parameters:
T- the type of the value- Parameters:
key- the keyvalue- the value- Returns:
- the action
-
compute
Returns an action that computes a state entry. If not present, the default value is used.- Type Parameters:
T- the type of the value- Parameters:
key- the keydef- the default valuefunction- the function to compute the value- Returns:
- the action
-
compute
Returns an action that computes a state entry if it exists.- Type Parameters:
T- the type of the value- Parameters:
key- the keyfunction- the function to compute the value- Returns:
- the action
-
without
Returns an action that removes a state entry.- Parameters:
key- the key- Returns:
- the action
-
back
Returns an action that goes back to the previous window. -
back
Returns an action that goes back to the window at the given depth.- Parameters:
depth- the depth- Returns:
- the action
-
hideAll
Returns an action that hides all windows in the hierarchy. -
audience
Returns an action mapping the viewer to anAudience.- Parameters:
consumer- the sub action running on the audience- Returns:
- the action
-
run
Returns an action that runs the given runnable.- Parameters:
runnable- the runnable- Returns:
- the action
-
command
Returns an action that invoke a command for the viewer. -
act
Executes the action.- Parameters:
window- the window
-
then
Returns a new action that first executes this action and then the given action.- Parameters:
next- the action to execute after this action- Returns:
- the new action
-