Is there a way to get a reference to Tab
or TabPane
without no improvised way if you have reference to only the Node
inside the Tab
for eg
TabPane tabPane = new TabPane();
Tab tab = new Tab();
tab.setText("new tab");
Rectangle drect = new Rectangle(200,200, Color.LIGHTSTEELBLUE);
tab.setContent(drect);
tabPane.getTabs().addAll(tab,new Tab("tab 2"));
assume i only have reference to drect
how can i get tab
.
I am not interested in Node.setUserData()
also drect.getParent().getClass().getName()
returns
TabPaneSkin
anon inner class TabContentRegion
: two strangers.
All i am trying to say is Node.getParent()
should return the parent Node
, general uni-knowledge ( node's representation in the scene graph can be traced with getParent() ), but, when it comes to Tab
s its all wrong, hence my question
EDIT
Why i needed this, suppose you have TabPane
consisting of soo many Tab
, in one particular Tab
you have a TreeView
s as its Node-Content
which is selected out of some conditions, and for that particular TreeView
you have different Custom Cell
s because its TreeItem
s differ in UI and function- like changing styles
binding Fonts
& other bindables and Animating Tab
hiding other Tab
s in the TabPane
, closing other Tab
s
with this scenario following this approach seems legit for me as, you do not do unnecessary stuff, like exposing children to bad weather. :-)
Thanks Sir James_D