This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Add a possibility to render check-boxes next to the tree node icon and display name | ||
---|---|---|---|
Product: | platform | Reporter: | Martin Entlicher <mentlicher> |
Component: | Outline&TreeTable | Assignee: | Martin Entlicher <mentlicher> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jglick, jrechtacek, jtulach |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 159545 | ||
Attachments: | The API change for review. |
Description
Martin Entlicher
2009-03-03 16:21:31 UTC
Created attachment 77648 [details]
The API change for review.
Please review this API change, which adds check-boxes to the nodes in tree column in Outline. In RenderDataProvider.java I've deleted sentence: " An Outline will use its RenderDataProvider to fetch data for <strong>all</strong> its columns, so it is possible to affect the display of both property columns and the tree column via this interface." Please review if it's correct, since AFAIK RenderDataProvider is used to render the tree column only. I've added CheckRenderDataProvider interface. That is used by DefaultOutlineCellRenderer to render the check-boxes. Outline handles the mouse events to change the selected status of check-boxes. To connect Nodes with Outline, I've introduced CheckNodeCookie, the connection is done by NodeRenderDataProvider. This API and functionality is going to be used by issue #159545. If there is nothing controversial, I would like to integrate this by the end of the week. Thanks. Thanks. It would be worth improvement of OV. Just some comments: JR01: Is there any chance to see it in action? Do you have any test for this change? JR02: It's weird. Both extensions of interfaces org.openide.explorer.view.CheckNodeCookie and org.netbeans.swing.outline.CheckRenderDataProvider have as same signature. Couldn't be shared? JR01: I've added a screenshot to issue #159545 - http://www.netbeans.org/nonav/issues/showattachment.cgi/77653/BP_CH.png I didn't write any test for this, programmatically test that the check-box is rendered would be an overkill IMHO. JR02: Although CheckRenderDataProvider and CheckNodeCookie are similar, I did not find a good way how to live with just one of them. Outline does not depend on anything and it would not be much nice to use some class from Outline when adding check-boxes into e.g. TreeView (if TreeView is extended in the future with check-boxes). The two interfaces differ, their signature is not the same: CheckRenderDataProvider have methods which take an Object as an argument - the node. There is one instance of it per the whole view. CheckNodeCookie have methods without arguments and they work in the context of the node the cookie is attached to. Therefore you have one instance per node. If there are no objections, I'll integrate this change tomorrow. Thanks for the review. Integrated in changeset: 119359:fbfb66e1cb38 http://hg.netbeans.org/main/rev/fbfb66e1cb38 Just saw this now, hope it's not too late to advise: [JG01] Don't use "Cookie" in the name and don't extend Node.Cookie. There is no more use for Node.Cookie after the introduction of Node.getLookup. Integrated into 'main-golden', will be available in build *200903090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/fbfb66e1cb38 User: mentlicher@netbeans.org Log: #159546 - CheckRenderDataProvider and CheckNodeCookie introduced to be able to render check-boxes next to the tree node icon. Jesse, I've just integrated the change yesterday in the evening. But I guess nobody started to use it yet. I was thinking about how to actually name the class and the cookie was handy to use, the Cookie interface is not deprecated, though I register the implementation into the Lookup. I can change the name to e.g. "CheckableNode" if it would sound better, without extending the Node.Cookie interface and explaining to add the impl into the Node's lookup... Node.Cookie is not @Deprecated as such - that would cause too many problems - but it is conceptually deprecated, i.e. no new code should mention it unless that is truly required for interoperation with older code. "CheckableNode" sounds fine to me. CCing Yarda in case he has any comments on the API style here. After discussion with Tomas Holy, I've replaced CheckNodeCookie with CheckableNode: http://hg.netbeans.org/main/rev/95ab2e9b0b9e Thanks for your comments. Integrated into 'main-golden', will be available in build *200903100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/95ab2e9b0b9e User: mentlicher@netbeans.org Log: #159546 - CheckNodeCookie is replaced with CheckableNode. Integrated into 'main-golden', will be available in build *200903101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/48f645103e4c User: mentlicher@netbeans.org Log: #159546 - CheckNodeCookie is replaced with CheckableNode. Parent node is not refreshed if a check box changes its state. I have to fire an event myself at CheckRenderDataProvider.setSelected() implementation. IMO, it should fire an event that node has been changed after crender.setSelected() is called at Outline.checkAt(). |