[REVIEW] Adding wildcards to cell factory API

Jonathan Giles jonathan.giles at oracle.com
Mon Feb 13 15:09:07 PST 2012


Hi all,

http://javafx-jira.kenai.com/browse/RT-17692

I'm hoping to have a discussion around modifying the cell factory API in 
TableView/TableColumn/ListView/TreeView to allow for the cell factories 
to produce subclasses of the TableRow/TableCell/ListCell/TreeCell 
classes respectively. I hope to do this in a compatible manner, but I 
need feedback from people if their generics-foo is stronger than mine, 
in case they can sense trouble.

In essence, my intention is to take the signature of the TableView 
rowFactory, for example, and replace it with a version that includes '? 
extends' for the return type of the Callback. For example, rather than:
private ObjectProperty<Callback<TableView<S>, TableRow<S>>> rowFactory;

I would like to see:
private ObjectProperty<Callback<TableView<S>, ? extends TableRow<S>>> 
rowFactory;

After changing the property, I would also like to change the signature 
of the getter/setter/*Property methods to have the same signature.

The main driver for this is in relation to custom controls such as 
TreeTable. In my proof of concept, I had to locally change TableView as 
above so that I could return the more useful TreeTableRow, rather than 
the forced-upon-me TableRow.

I appreciate your feedback.

-- 
-- Jonathan



More information about the openjfx-dev mailing list