Proposal for improving nested controller interaction in JavaFX 2.2 (original) (raw)
Jeff McDonald deep.blue.6802 at gmail.com
Wed Feb 22 00:31:52 PST 2012
- Previous message: Proposal for improving nested controller interaction in JavaFX 2.2
- Next message: Proposal for improving nested controller interaction in JavaFX 2.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Richard is one time zone closer to you than I am ... I'm up late. I'm a night owl.
Yes, I'd forgotten about the lookup method. Thanks for the reminder. using the lookup method works for the three most useful scenarios for me (1) get a component by id. (2) Get a component by providing a selector expression. (3) get a component by class. It looks as if the Node API and the lookup method offers the DOM style functionality I was discussing in my previous post.
Cheers, Jeff
On Wed, Feb 22, 2012 at 12:34 AM, Jonathan Giles <jonathan.giles at oracle.com> wrote:
+1 This brings me to my next question. Once you bring a scene graph into memory, what utils/tools does the JavaFX offer or support for traversing the scene graph? FXML would benefit from having tools/utils that make it easier to query and traverse the scene graph. A DOM like API would be nice. A DOM would allow developers to do something like: Button submitButton scene.getById("submitbutton"); //Gets the object with an fx.id == "submitbutton" submitButton.onMouseClicked(clickHandler);
XPath could be used to traverse and query the graph. The graph can be treated like XML and the graph is essentially a DOM instance. I'll leave Rich to expand on this tomorrow (if he feels compelled), but given it appears you're closer to my time zone (NZ) than his (US) (or you just work late), I thought I'd quickly respond to point you to the Node.lookup(String selector) and Node.lookupAll(String selector) methods here: http://docs.oracle.com/javafx/2.0/api/javafx/scene/Node.html#lookup%28java.lang.String%29 You can also find similar methods in Scene: http://docs.oracle.com/javafx/2.0/api/javafx/scene/Scene.html#lookup%28java.lang.String%29 -- Jonathan
- Previous message: Proposal for improving nested controller interaction in JavaFX 2.2
- Next message: Proposal for improving nested controller interaction in JavaFX 2.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]