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.

Bug 143778 - org.netbeans.swing.outline.Outline ignores RenderDataProvider#getIcon() result in table columns
Summary: org.netbeans.swing.outline.Outline ignores RenderDataProvider#getIcon() resul...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 15:28 UTC by hallorant
Modified: 2010-10-07 11:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Code Snippet (5.70 KB, text/plain)
2008-08-13 15:29 UTC, hallorant
Details
Icon used by the code snippet (592 bytes, image/gif)
2008-08-13 15:30 UTC, hallorant
Details
Screenshot showing icons missing in table cells (54.03 KB, image/png)
2008-08-13 15:31 UTC, hallorant
Details
Screenshot showing icons missing in table cells (with column headings) (55.73 KB, text/plain)
2008-08-13 15:33 UTC, hallorant
Details
custom renderer for table cells (6.38 KB, text/plain)
2008-08-21 10:23 UTC, Stanislav Aubrecht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hallorant 2008-08-13 15:28:33 UTC
The new Outline control ignores the icons specified by its RenderDataProvider in table columns.

I consider this a bug because the table columns do respect the other aspects of the RenderDataProvider, e.g., colors,
tooltips, etc.  Also it is not at all obvious how to attach a custom renderer to the table portion to fix this with the
current API.  I therefore propose that this API behavior should be changed to that table entries show the icons
specified by the Outline's RenderDataProvider.

I've attached a snippet that you can get running by putting OutlineSnippet.java and asterisk.gif into the
default package.  You'll also need to include org-netbeans-swing-netbeans-outline.jar I got the one I'm using from
netbeans-trunk-nightly-200808060201-javase.zip downloaded from netbeans.org.


Steps to duplicate:  Run the snippet to get the screenshot I've attached.  The tree items have icons the table entries
do not -- the table entries should have icons.

(Aside: this API also seems to lack the ability to expand the tree programatically -- expandAll() show(tree item) for
example but I'm not sure yet if this is a bug)
Comment 1 hallorant 2008-08-13 15:29:33 UTC
Created attachment 67272 [details]
Code Snippet
Comment 2 hallorant 2008-08-13 15:30:16 UTC
Created attachment 67273 [details]
Icon used by the code snippet
Comment 3 hallorant 2008-08-13 15:31:32 UTC
Created attachment 67274 [details]
Screenshot showing icons missing in table cells
Comment 4 hallorant 2008-08-13 15:33:27 UTC
Created attachment 67276 [details]
Screenshot showing icons missing in table cells (with column headings)
Comment 5 Stanislav Aubrecht 2008-08-20 15:06:19 UTC
maybe i don't understand what this issue is about but i don't see any bug here. table cells (not in tree column) are not
expandable so there's no need to provide icons for them. but if you do want icons there, just provide custom
TableCellRenderer for those columns. 
i suppose javadoc for RenderDataProvider just be fixed to make it clear that icons are for tree column only.
or am i missing something?
Comment 6 hallorant 2008-08-20 15:49:50 UTC
The bug is bad API design.  The RenderDataProvider should not provide data for the entire tree-table except icons in the
table columns.  Your statement "table cells (not in tree column) are not expandable so there's no need to provide icons
for them." is just strange.  If I don't want icons in those columns I simply program my RenderDataProvider to not
dispense icons. 

I filed the bug (and spent time building the snippet) to help produce an API that felt like the control was an Outline
-- not like a tree and a table taped together with duck tape and "band aids."  Is this control an abstraction or a hack?

I could not get your solution of using TableCellRenderer to work. Do you have an example?  Or could you update the
snippet to work properly?  Thanks!
Comment 7 Stanislav Aubrecht 2008-08-21 10:23:54 UTC
Created attachment 68014 [details]
custom renderer for table cells
Comment 8 Stanislav Aubrecht 2008-11-11 15:35:36 UTC
hallorant, does my custom renderer sample code work for you?
Comment 9 hallorant 2008-11-21 20:38:37 UTC
Yes, I still believe the API is clunky...but many thanks for the example.
Comment 10 Lukas Hasik 2008-12-04 13:02:11 UTC
I'm closing as worksforme as the issue is INCOMPLETE for more than 14 days. 
Please feel free to file new enhancements/bugs about the API design. Or reopen this one. 
Comment 11 Stanislav Aubrecht 2008-12-04 13:56:54 UTC
i think the issue is still valid as an API enhancement