NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Auto-Expand nodes in BeanTreeView

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
chaddaniels



Joined: 16 Oct 2008
Posts: 37

PostPosted: Tue Oct 21, 2008 7:39 pm    Post subject: Auto-Expand nodes in BeanTreeView Reply with quote

Does anybody know if there is a way to make a Node auto-expand when child nodes are added to it? When using a regular JTree and TreeModel I would normally add a TreeModelListener and expand the parent node on treeNodesInserted. Is there a similar approach for BeanTreeView?
Back to top
tomwheeler



Joined: 03 Sep 2008
Posts: 950

PostPosted: Wed Oct 22, 2008 1:07 am    Post subject: Auto-Expand nodes in BeanTreeView Reply with quote

I suppose you could add a NodeListener to the root context of the node
the BeanTreeView is associated with, then calculate a TreePath for the
new node's parent and call BeanTreeView.showPath to display it.

Note the following from the NodeListener javadoc; it should save you
some headaches:

The listener is not notified about changes in subnodes until
the method getChildren().getNodes() is called


On Tue, Oct 21, 2008 at 2:39 PM, chaddaniels <address-removed> wrote:
Quote:
Does anybody know if there is a way to make a Node auto-expand when child nodes are added to it? When using a regular JTree and TreeModel I would normally add a TreeModelListener and expand the parent node on treeNodesInserted. Is there a similar approach for BeanTreeView?








--
Tom Wheeler
http://www.tomwheeler.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo