Interface ComponentPath

All Known Implementing Classes:
ComponentPath.Leaf, ComponentPath.Path

public interface ComponentPath
Represents a path of components in a user interface hierarchy.

It provides methods to create and manipulate component paths.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    The Leaf class represents a leaf component path in the hierarchy.
    static final record 
    The Path class represents a non-leaf component path in the hierarchy.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyFocus(boolean pFocused)
    Applies focus to or removes focus from the component associated with this component path.
     
    leaf(GuiEventListener pComponent)
    Creates a leaf component path with the specified GuiEventListener component.
    path(ContainerEventHandler pComponent, ComponentPath pChildPath)
    Creates a component path with the specified ContainerEventHandler component and an optional child path.
    path(GuiEventListener pLeafComponent, ContainerEventHandler... pAncestorComponents)
    Creates a new ComponentPath leaf node with the specified GuiEventListener component and an array of ContainerEventHandler ancestors.
  • Method Details

    • leaf

      static ComponentPath leaf(GuiEventListener pComponent)
      Creates a leaf component path with the specified GuiEventListener component.

      Parameters:
      pComponent - the component associated with the leaf path
      Returns:
      a new leaf component path.
    • path

      @Nullable static ComponentPath path(ContainerEventHandler pComponent, @Nullable ComponentPath pChildPath)
      Creates a component path with the specified ContainerEventHandler component and an optional child path.

      Parameters:
      pComponent - the component associated with the path
      pChildPath - the child path associated with the component
      Returns:
      a new component path, or null if the child path is null
    • path

      static ComponentPath path(GuiEventListener pLeafComponent, ContainerEventHandler... pAncestorComponents)
      Creates a new ComponentPath leaf node with the specified GuiEventListener component and an array of ContainerEventHandler ancestors.

      Parameters:
      pLeafComponent - the new 'Leaf' component associated with the path
      pAncestorComponents - the array of ancestor components associated with the path, ordered in reverse ascending order towards root.
      Returns:
      a new component path
    • component

      GuiEventListener component()
    • applyFocus

      void applyFocus(boolean pFocused)
      Applies focus to or removes focus from the component associated with this component path.
      Parameters:
      pFocused - true to apply focus, false to remove focus.