开发者

Change the handle of the displayed node programmatically

I have t开发者_StackOverflowhis tree displaying the file structure, I have folders and files. Some folders are not accessible and I am disabling them (they appear as grayed out in the UI) - I am doing this in the node renderer. The thing is that these folders still have the "+" icon (handle or what's it called) before the folder icon. I am trying to change that.

Is there a way for me to change the node handle from "+" to "-" programatically ? Like when I decide that a node is not accessible to make the handle "-" in the node renderer or something?


Note that the "minus" icon/handle is rendered when a node is expanded (e.g. you can see the content of the node). I am assuming that you want the node to not have any children, therefore no minus or plus handle will be rendered.


If you want these nodes to not have any children you can call setAllowsChildren(false) on them. Or if you are implementing the TreeNode interface you return true from isLeaf().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜