Interface ActionContext

All Known Implementing Classes:
ActionContextImpl

public interface ActionContext
  • Method Details

    • getEventGroup

      String getEventGroup()
    • getEventName

      String getEventName()
    • getComponent

      PerspectiveElement getComponent()
    • getConfig

      ActionConfig getConfig()
    • current

      static Optional<ActionContext> current()
      The action whose script is running on the calling thread, or empty on a thread that is not inside one. Lets code a script reaches tell which event is driving it: a ComponentModelDelegate's @ScriptCallable method otherwise cannot distinguish a call made from an event handler from one made anywhere else.

      Still reports the action across a nested invocation the script makes — a component custom method, a project library function — since only enter(ActionContext) touches the binding.

    • enter

      static ActionContext.Binding enter(ActionContext context)
      Binds context to the calling thread for the duration of a script action's invocation. Framework use; close the returned handle in a finally or try-with-resources.

      Restores the previous binding rather than clearing it, so an action invoked from inside another one does not erase its caller on the way out.