Skip to content

Instantly share code, notes, and snippets.

@ykubota
Last active September 3, 2015 01:13
Show Gist options
  • Save ykubota/518fe67b8f86b1c448dd to your computer and use it in GitHub Desktop.
Save ykubota/518fe67b8f86b1c448dd to your computer and use it in GitHub Desktop.
dump JavaFX Node struct to show all Java classes and css style classes.
import javafx.scene.Node;
import javafx.scene.Parent;
// :
private void dump(Node n, int depth) {
for (int i = 0; i < depth; i++) System.out.print(" ");
System.out.println(n);
if (n instanceof Parent) for (Node c: ((Parent) n).getChildrenUnmodifiable()) dump(c, depth + 1);
}
// :
import javafx.scene.Node;
import javafx.scene.Parent;
// :
private void dump(Node n, int depth) {
for (int i = 0; i < depth; i++) System.out.print(" ");
System.out.println(n);
if (n instanceof Parent) ((Parent) n).getChildrenUnmodifiable().stream().forEach((c) -> {
dump(c, depth + 1);
});
}
// :
@ykubota
Copy link
Author

ykubota commented Sep 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment