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

Summary: Hide/show RowModel value depending on RowModel.getValueFor()
Product: platform Reporter: pttorgenrud <pttorgenrud>
Component: Outline&TreeTableAssignee: Martin Entlicher <mentlicher>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

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
items.
- 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
possible.

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.