Class ContainerSkin.IndexFocusTraversalPolicy

  • All Implemented Interfaces:
    FocusTraversalPolicy
    Enclosing class:
    ContainerSkin

    public static class ContainerSkin.IndexFocusTraversalPolicy
    extends java.lang.Object
    implements FocusTraversalPolicy
    Focus traversal policy that determines traversal order based on the order of components in the container's component sequence.
    • Constructor Detail

      • IndexFocusTraversalPolicy

        public IndexFocusTraversalPolicy()
        Create a new policy with default wrap behavior (that is, don't wrap).
      • IndexFocusTraversalPolicy

        public IndexFocusTraversalPolicy​(boolean newWrap)
        Create a new policy using the given wrap value.
        Parameters:
        newWrap - Whether or not the policy should wrap around the ends of the container.
    • Method Detail

      • getNextComponent

        public Component getNextComponent​(Container container,
                                          Component component,
                                          FocusTraversalDirection direction)
        Description copied from interface: FocusTraversalPolicy
        Returns the next focus destination according to this traversal policy.
        Specified by:
        getNextComponent in interface FocusTraversalPolicy
        Parameters:
        container - The container to which the traversal policy applies.
        component - The component from which focus is being transferred. If null, implementations should return the first component for a forward traversal and the last component for a backward traversal.
        direction - The direction in which to transfer focus.
        Returns:
        The component to focus, or null if there are no more components in the given direction or next component cannot be determined.