mkpaz / devtoolsfx

A tool for navigating JavaFX scene graph and exploring node properties
MIT License
38 stars 1 forks source link

Add possibility to inspect not whole application or stage, but concrete Nodes #1

Closed PavelTurk closed 1 month ago

PavelTurk commented 1 month ago

Let's consider, that I have a tab application with multiple tabs and I want to inspect only concrete tab. That's why I suggest possibility to inspect concrete Nodes, Tabs etc but not whole application

For example, my application:

Stage
 |- TabPane
     |-Tab 1
     |-Tab 2
        |- VBox
             |-ToolBar
             | ....

So, to inspect only Tab 2 (and all its children) I do:

var toolPane = GUI.createToolPane(tab2, Preferences preferences, tab2.getText());
mkpaz commented 1 month ago

I started with this, but as the API evolved, I abandoned it due to the high cost for a very niche feature. For example, the application listens for scene root changes and updates the UI accordingly. But what if someone replaces the Tab object, removes it from the scene graph, or moves the scene to another stage? How should the application react? These are just edge cases, and there are more. I believe it's better to focus on the root node, as it can always be obtained from any scene.

PavelTurk commented 1 month ago

@mkpaz Thank you for your reply. This way is it possible to "scroll" to concrete tab? For example, we have toolPane for stage, but open node tree in concrete Tab?

mkpaz commented 1 month ago

Yes, there's a search feature for the scene graph tree. It scrolls to the node whose name, class, or ID matches the search string, expanding all parent nodes along the way.