Focus Traversal of Nodes / Cells in TreeTableView

Daniel Glöckner daniel.gloeckner at 360t.com
Mon Aug 15 14:53:40 UTC 2016


Hi,

We're trying to implement an editable data grid using a TreeTableView.

The tree table contains nodes:
List<TreeTableColumn<SomeModel, Node>> columns = ...;
theTreeTable.getColumns().setAll(columns);

Some of the nodes are custom controls (basically advanced text fields) which are editable:

someColumn.setCellValueFactory(cellDate -> {
			SomeModel lineModel = cellDate.getValue().getValue();
			Node someEditor = GuiComponentUtils.createEditorComponent();
			someEditor.setModel(lineModel);
			return new SimpleObjectProperty<>( someEditor);
		});

The task at hand is to make these controls focus traversable (column by column and row by row). 
We have to consider the case that the table is not fully visible, i.e. wrapped in a ScrollPane. This does not work out of the box since the components might not exist if they are not visible.

Any ideas how this could be implemented? Is this case considered at all in JavaFX's implementation of focus traversal? Maybe it will be in Java 9?

Kind regards,
Daniel







More information about the openjfx-dev mailing list