Class FocusTraversalPolicy

    • Constructor Detail

      • FocusTraversalPolicy

        public FocusTraversalPolicy()
    • Method Detail

      • findNextContentPart

        protected IContentPart<? extends javafx.scene.Node> findNextContentPart​(IContentPart<? extends javafx.scene.Node> current)
        Determines the next IContentPart to which keyboard focus is assigned, depending on the currently focused IContentPart.

        The first content part child of the given focus part is returned as the next part if a content part child is available.

        The next content part sibling of the given focus part is returned as the next part if a content part sibling is available. When one sibling list ends, the search continues with the parent's siblings until it reaches the root of the hierarchy.

        If the next content part cannot be determined, null is returned.

        Parameters:
        current - The currently focused IContentPart.
        Returns:
        The next IContentPart to which keyboard focus is assigned, or null if no subsequent IContentPart could be determined.
      • findPreviousContentPart

        protected IContentPart<? extends javafx.scene.Node> findPreviousContentPart​(IContentPart<? extends javafx.scene.Node> current)
        Determines the previous IContentPart to which keyboard focus is assigned, depending on the currently focused IContentPart.

        At first, the previous content part sibling of the given focus part is determined. If a siblings list ends, the search continues with the parent's siblings.

        The inner most content part child of the previous content part sibling is returned as the previous content part, or null if no previous content part sibling could be found.

        Parameters:
        current - The currently focused IContentPart.
        Returns:
        The previous IContentPart to which keyboard focus is assigned, or null if no previous IContentPart could be determined.
      • focusNext

        public IContentPart<? extends javafx.scene.Node> focusNext()
        Assigns focus to the next part in the traversal cycle. Returns the IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.
        Returns:
        The IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.
      • focusPrevious

        public IContentPart<? extends javafx.scene.Node> focusPrevious()
        Assigns focus to the previous part in the traversal cycle. Returns the IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.
        Returns:
        The IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.
      • init

        public void init()
        Description copied from class: AbstractPolicy
        Initializes the policy, so that the policy's "work" methods can be used. Calling a "work" method while the policy is not initialized will result in an IllegalStateException, as well as re-initializing before committing or rolling back.
        Specified by:
        init in interface IPolicy
        Overrides:
        init in class AbstractPolicy
      • traverse

        protected IContentPart<? extends javafx.scene.Node> traverse​(boolean backwards)
        Traverses the focus forwards or backwards depending on the given flag. Returns the IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.
        Parameters:
        backwards - true if the focus should be traversed backwards, otherwise false.
        Returns:
        The IContentPart to which focus is assigned by the operation of this policy, or null if focus is assigned to the viewer.