Enum Class TInputContext.InputDiscoveryPhase

java.lang.Object
java.lang.Enum<TInputContext.InputDiscoveryPhase>
io.github.thecsdev.tcdcommons.api.client.gui.util.TInputContext.InputDiscoveryPhase
All Implemented Interfaces:
Serializable, Comparable<TInputContext.InputDiscoveryPhase>, Constable
Enclosing class:
TInputContext

public static enum TInputContext.InputDiscoveryPhase extends Enum<TInputContext.InputDiscoveryPhase>
This refers to the current "phase" at which an input is being handled.
Each input phase has its own unique behaviors.
  • Enum Constant Details

    • BROADCAST

      public static final TInputContext.InputDiscoveryPhase BROADCAST
      During this input phase, the input is forwarded to all elements, sequentially, starting from the root parent.

      This phase is solely for the purpose of elements being able to know an input took place. Any elements handling the input on this phase will have no effect on the input propagation, and will not be able to prevent the TInputContext.InputDiscoveryPhases that follow.

    • PREEMPT

      public static final TInputContext.InputDiscoveryPhase PREEMPT
      This phase is similar to BROADCAST, except elements are able to stop the input propagation by handling the input. Doing so will prevent MAIN from being handled.
      See Also:
    • MAIN

      public static final TInputContext.InputDiscoveryPhase MAIN
      During this input phase, the input is forwarded to the currently focused or hovered element (depending on the input type), after which the input "bubbles" towards the root parent element, until the input gets handled by the target element or one of its parents.
  • Method Details

    • values

      public static TInputContext.InputDiscoveryPhase[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TInputContext.InputDiscoveryPhase valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null