I have a JavaFX app with the following Node layout:
- SplitPane
- TextArea
- SplitPane
- TabPane
- TabPane

Example Code:
SplitPane topBottomSplitPane = new SplitPane();
TextArea displayTextArea = new TextArea();
SplitPane leftRightSplitPane = new SplitPane();
topBottomSplitPane.getItems().addAll(displayTextArea, leftRightSplitPane);
TabPane leftTabPane = new TabPane();
TabPane rightTabPane = new TabPane();
leftRightSplitPane.getItems().addAll(leftTabPane, rightTabPane);
The TextArea, displayTextArea, is an non-editable text area that displays some text-data depending upon what data is present in the opened Tab objects inside the two TabPanes, leftTabPane and rightTabPane. The TabPane's SelectionModel is singular so that only one Tab may be selected at a time per TabPane.
One of the constraints I have is that only one of the open Tab objects data should be influencing displayTextArea's text. This was easy to accomplish when there was only one TabPane object by setting a OnSelectionChanged EventHandler and using isSelected() to determine if the change of selection was either a change into or out of selection. And the selected Tab would be the one influencing displayTextArea.
When there are two TabPanes I would want the Tab who's Content Node currently has focus, say a TextField or form where the user is entering data that will affect the text of displayTextArea. The way it would look from a user's perspective is they will be clicking through the open Tabs in both the TabPanes and the last one they clicked on would be influencing displayTextArea. But that is where I am running into a wall.
Attempted and Failed Approaches:
Setup some kind of listener to be notified of a change in focus from one of the Tab's content Node into another Tab's content Node, regardless of which TabPane they are in, then update the displayTextArea accordingly. - There is no AddFocusListener method and I am unsure how to work with the available focus oriented methods and functionality to achieve this behavior.
Force only 1 Tab to be selected at any one time between multiple TabPanes and stick with the aforementioned OnSelectionChanged EventHandler approach. - I don't know where to start on this one and I have not been able to find anything on it.
In this question there is the topic of changing focus into a TextField object in the Tab's Content Node but I was unable to grab anything useful for my purpose from that post.
I am lost here and don't know how to implement the necessary functionality for this display.