TableView Cell Span

Is there a way to make TableCell horizontally? I want to create a table view in JavaFX 2.2, similar to that shown in the attached image

sample
(source: fxexperience.com )

By the way, the image is obtained from a sample of this functionality, but it is specific to Java FX 8.0. I tried to use rowFactory, but not enough documentation on how to use it.

Thank you in advance.

+6
source share
1 answer

A cell spanning the JavaFX platform was implemented for Java 8, and then cut as part of a function. He may move on to a future release.

Request Tracking Function for Cellular Communications RT-24747 Cell Mapping / Merging in TableView . (This is just a request for the function that provided the image indicated in your question).

A related function request includes sample code for displaying a table with overlapping rows and columns for cells. The sample code is based on a patch attached to a function request. The patch modifies the JavaFX control code for Java 8.

You can examine the code and the patch in the function request to determine if you can implement such a technology for yourself in the user code without fixing the JavaFX runtime.


The only code I know that sets up the factory string is openjfx code to handle the default rows of the TableView - and it's not easy. For reference, the code is in TableRow.java , TableRowSkinBase.java and TableRowSkin.java .

An alternative to implementing your own factory row is Updating the appearance of the TableView row , which uses css to change the style of certain cells or the entire row, and not to create using a fully custom factory row. Instead of embedding a whole new factory row, you can get the effect you want by modifying the CSS styles to remove line separators between linked cells.

Using the ScenicView or SceneBuilder CSS Analyzer tools can help determine the necessary CSS styles that need to be changed.

+10
source

Source: https://habr.com/ru/post/946540/


All Articles