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 160397 - Hide/show RowModel value depending on RowModel.getValueFor()
Summary: Hide/show RowModel value depending on RowModel.getValueFor()
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
Depends on:
Reported: 2009-03-16 18:41 UTC by pttorgenrud
Modified: 2010-10-07 11:33 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description pttorgenrud 2009-03-16 18:41:16 UTC
Version 1.4 from March 12.

Use case:
- Tree consists of nodes in which a parent of one type has children of different type. In my case, I'm implementing a
graph-like structure as a tree, and the tree model consists of nodes different type: String labels, Node items, and Edge
- Some types represented in the tree should be "selectable" and some should not be "selectable". In my example, I'd like
to present a checkbox in a column for Edge items but NO checkbox in the column for labels or Node items. For my
application, it makes no sense to select the labels or Node items, only Edges.

The behaviour now is that if I tell getColumnClass to return Boolean.class for a particular column, then RowModel shows
a checkbox for *all* rows of a column, no matter what I return in getValueFor().

Since different parent and child types seems to me like a pretty common use case for trees, I'm thinking this should be

I think an intuitive way to do this would be that if RowModel.getColumnClass() defines a column type as Boolean.class
(or any other type, really) then RowModel.getValueFor() could return a value for rows for which the value should be
presented and return null for rows for which a value should NOT be presented.

Perhaps there's already a way, though, to do this that I haven't seen? I've been looking through the API and I just
don't see a way to do what I need. Hopefully I'm missing something.