Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088862

Provide possibility to traverse focus out of FX scene

    Details

      Description

      Transparent focus traversal is one of key features of FX/Swing interoperability. This includes both directions:

      1. Transferring focus from Swing to FX. JFXPanel should accept Swing focus and dispatch it to proper SceneGraph nodes.
      2. Transferring focus from FX to Swing. When FX focus reaches the beginning/end of the focus chain, focus should be transferred out to Swing.

      #1 is currently implemented as a part of EmbeddedStageInterface. To support #2, there should be an ability to register a listener for focus "wraps": when TraversalEngine detects that focus reaches the beginning/end of the focus loop, it should ask the listener if it's able to dispatch focus out of FX scene.

        Issue Links

          Activity

          art Artem Ananiev created issue -
          art Artem Ananiev made changes -
          Field Original Value New Value
          Assignee Kevin Rushforth [ kcr ] Artem Ananiev [ art ]
          art Artem Ananiev made changes -
          Status New [ 10000 ] In Progress [ 3 ]
          Hide
          art Artem Ananiev added a comment -
          Proposed changes:

          1. Add two methods to TraversalEngine: setTraverseOutListener(), clearTraverseOutListener().

          2. Make Algoritm.traverse() not only return an index of the component to be focused, but also a flag if a focus loop is wrapped at this step.

          3. Add new method to TKScene: traverseOut()

          Then the sequence of traversal will be:

          1. On every set/change scene's root, the scene registers a traverseOutListener on root's traversal engine.

          2. On every forward focus traversal, if the next component to focus is the first one (that is, a wrap will take place), the engine first ask the listener for focus out traversal, and if the listener rejects, makes the first component focused.

          3. The same for backward focus traversal.

          4. Scene's traverseOutListener just forwards the request to the scene peer.

          5. Regular peers (e.g. ViewScene) just return false from traverseOut().

          6. EmbeddedScene.traverseOut() forwards the request to its embedder (HostInterface.traverseFocusOut() method).
          Show
          art Artem Ananiev added a comment - Proposed changes: 1. Add two methods to TraversalEngine: setTraverseOutListener(), clearTraverseOutListener(). 2. Make Algoritm.traverse() not only return an index of the component to be focused, but also a flag if a focus loop is wrapped at this step. 3. Add new method to TKScene: traverseOut() Then the sequence of traversal will be: 1. On every set/change scene's root, the scene registers a traverseOutListener on root's traversal engine. 2. On every forward focus traversal, if the next component to focus is the first one (that is, a wrap will take place), the engine first ask the listener for focus out traversal, and if the listener rejects, makes the first component focused. 3. The same for backward focus traversal. 4. Scene's traverseOutListener just forwards the request to the scene peer. 5. Regular peers (e.g. ViewScene) just return false from traverseOut(). 6. EmbeddedScene.traverseOut() forwards the request to its embedder (HostInterface.traverseFocusOut() method).
          kcr Kevin Rushforth made changes -
          Component/s Scenegraph [ 10381 ]
          rgregor Richard Gregor made changes -
          Fix Version/s Presidio [ 10293 ]
          art Artem Ananiev made changes -
          Fix Version/s Lombard [ 10380 ]
          Fix Version/s Presidio [ 10293 ]
          art Artem Ananiev made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          kcr Kevin Rushforth made changes -
          Issue Type Task [ 3 ] Feature [ 2 ]
          ogb Oleg Barbashov (Inactive) made changes -
          Link This issue is related to RT-18085 [ RT-18085 ]
          Hide
          psafrata Pavel Šafrata added a comment -
          This issue has been reported as a bug, because without it embedding can't work properly. Changing type from Feature to Bug.
          Show
          psafrata Pavel Šafrata added a comment - This issue has been reported as a bug, because without it embedding can't work properly. Changing type from Feature to Bug.
          psafrata Pavel Šafrata made changes -
          Issue Type Feature [ 2 ] Bug [ 1 ]
          art Artem Ananiev made changes -
          Security Internal [ 10032 ] Public [ 10031 ]
          art Artem Ananiev made changes -
          Link This issue duplicates RT-24136 [ RT-24136 ]
          Hide
          art Artem Ananiev added a comment -
          RT-24136 is closed as duplicate of this one. Note, however, that is may happen that to make JFXPanel work it's not enough to fix this bug. In that case, RT-24136 will be re-opened to track JFXPanel part of focus traversal.
          Show
          art Artem Ananiev added a comment - RT-24136 is closed as duplicate of this one. Note, however, that is may happen that to make JFXPanel work it's not enough to fix this bug. In that case, RT-24136 will be re-opened to track JFXPanel part of focus traversal.
          art Artem Ananiev made changes -
          Assignee Artem Ananiev [ art ] Anton V. Tarasov [ ant ]
          art Artem Ananiev made changes -
          Link This issue duplicates RT-28846 [ RT-28846 ]
          Hide
          akirov Alexander Kirov (Inactive) added a comment -
          RULE ControlsAutomatedTestSuite/javafx/scene/control/test/fxcanvas/FXCanvasTest/focusTest Exception java.lang.AssertionError:
          Show
          akirov Alexander Kirov (Inactive) added a comment - RULE ControlsAutomatedTestSuite/javafx/scene/control/test/fxcanvas/FXCanvasTest/focusTest Exception java.lang.AssertionError:
          akirov Alexander Kirov (Inactive) made changes -
          Labels focus focustraversal interoperability FXCanvas focus focustraversal interoperability
          ant Anton Tarasov made changes -
          Fix Version/s Lombard [ 10380 ]
          Fix Version/s Van Ness [ 10750 ]
          duke J. Duke (Inactive) made changes -
          Component/s javafx [ 12520 ]
          Component/s Scenegraph [ 10381 ]
          duke J. Duke (Inactive) made changes -
          Workflow jfxc-workflow-v2 [ 40418 ] JBS Workflow [ 122489 ]
          squierts Tony Squier made changes -
          Project Import Fri Jun 12 21:05:53 UTC 2015 [ 1434143153521 ]
          squierts Tony Squier made changes -
          Component/s javafx [ 12124 ]
          Project Runtime [ 11000 ] JDK [ 10100 ]
          Key RT-10919 JDK-8088862
          Fix Version/s 9 [ 14949 ]
          Fix Version/s 9 [ 17733 ]
          Affects Version/s fx2.0 [ 17654 ]
          Affects Version/s fx2.0 [ 17710 ]
          Imported 12/Jun/15 3:35 PM
          Component/s javafx [ 11900 ]
          squierts Tony Squier made changes -
          Subcomponent scenegraph [ 1512 ] scenegraph [ 1387 ]
          ant Anton Tarasov made changes -
          Issue Type Bug [ 1 ] Enhancement [ 7 ]
          vdyakov Victor Dyakov made changes -
          Assignee Anton Tarasov [ ant ] Alexander Zvegintsev [ azvegint ]
          vdyakov Victor Dyakov made changes -
          Fix Version/s 10 [ 16302 ]
          Fix Version/s 9 [ 14949 ]
          vdyakov Victor Dyakov made changes -
          Fix Version/s tbd_major [ 11972 ]
          Fix Version/s 10 [ 16302 ]

            People

            • Assignee:
              azvegint Alexander Zvegintsev (Inactive)
              Reporter:
              art Artem Ananiev
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: