Cell spanning in version 2.2

Jonathan Giles jonathan.giles at oracle.com
Fri May 17 08:05:25 PDT 2013

Hi Neil,

Assuming your question is "given the OpenJFX code base, is someone in 
the community able to extend TableView to (mostly) support cell spanning 
for themselves", then the answer is yes. If you're asking whether we can 
add cell spanning support to JavaFX for a 2.x release, then the answer 
is almost certainly a no.

Cell spanning is like TreeTableView to me. It's something that is 
relatively easy to hack together, but there were a thousand loose ends 
that needed to be tidied up. The two biggest areas for cell spanning 
that were left unresolved (due to lack of time, not difficulty) were 
keyboard navigation and the need to support fixed columns / 
'locked-together' columns (so that cells that spanned columns couldn't 
be split up by the user rearranging the columns so that they were no 
longer adjacent).

To answer your question about why it appeared in the JavaFX 8.0 repos 
and then disappeared: it's because I was exploring the domain and didn't 
want to have a branch specifically for cell spanning. Once you do that, 
and are concurrently fixing bugs / adding features in the main branch 
for TableView, you end up with a merge nightmare. I was also hoping I 
might have time to actually implement it well enough to get it into 
JavaFX 8.0, but as always time conspires against these kind of things.

You may be interested in my JavaOne talk, which I believe is available 
online at [1]. At that point my code was actually a separate control (a 
'CellSpanTableView'). Following that talk I folded it all into the code 
that underpins TableView / TreeTableView (most notably 
TableRowSkinBase). If you're wanting to roll your own code, the best 
starting point is the JavaFX 8.0 repo - just go back into the history 
and pull out the relevant classes (CellSpan, SpanModel, TableView, 
TableRowSkin / TableRowSkinBase). You should be able to get a basic 
implementation up and running quite easily.

I hope that helps.

[1] http://www.youtube.com/watch?v=udc2iRZBF0M

-- Jonathan

On 17/05/2013 6:22 a.m., Neil Galarneau wrote:
> Is Cell spanning in TableView in Java 7 possible to implement?
> I have read Jonathan's FX experience article on the topic. I've seen
> in RT-24747 that the code was added into Java 8 last year & then
> removed early this year. I didn't see (on this list or in Jira) why it
> was removed.
> It is ok with me if there the implementation isn't perfect. For
> example, if keyboard navigation is a little strange that is ok by me.
> Thanks in advance for any advice,
> Neil

More information about the openjfx-dev mailing list