0

Explanation of TreeOpenableModel.addOpenPath()

asked 2012-06-19 15:37:23 +0800

szarza gravatar image szarza
62 2
http://balteus.blogspot.c...

Hello:
I don't understand how addOpenPath() and addOpenPaths() works. I have a populated tree with a with a three elements model. Doing

    AbstractTreeModel t = (AbstractTreeModel)tree.getModel();
    t.addOpenPath(new int[]{1});

opens second element, but doing:

    AbstractTreeModel t = (AbstractTreeModel)tree.getModel();
    t.addOpenPath(new int[]{0,1,2});

opens no one.

What I'm doing wrong?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-07-24 02:31:43 +0800

paowang gravatar image paowang
140 6

The argument you pass to the addOpenPath() method is a tree path.
If the three element in your tree model are both sibling, we should invoke TreeOpenableModel.addOpenPaths(new int[][]{{0}, {1}, {2}}) to open them.

link publish delete flag offensive edit

answered 2012-07-26 07:24:19 +0800

szarza gravatar image szarza
62 2
http://balteus.blogspot.c...

Ahh. Ok. I understand.
Thank you.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-06-19 15:37:23 +0800

Seen: 156 times

Last updated: Jul 26 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More