I have a treetable and I want to set all seen items (focused with mouse) font-weight:normal instead of bold.
But I dont get the treetablerow to archive that. So I need a method which returns the selected treetablerow like the following:
getSelectedTreeTableRow().setStyle("-fx-font-weight: normal;");
The code I've written already is the following but it doesn't work anyway.
TreeTableView.TreeTableViewSelectionModel selectionModel = m_treeTableMaster.getTreeTableView().getSelectionModel();
ObservableList selectedCells = selectionModel.getSelectedCells();
TreeTablePosition tablePosition = (TreeTablePosition) selectedCells.get(0);
tablePosition.getTableColumn().setStyle("-fx-font-weight: normal;");
I set the rows bold in a cellstyler class when the table is initialized:
m_treeTableMaster.setCellStyler(new ICellStyler()
{
@Override
public void OnStyleCell(MyTableCell p_cell, Object item, boolean empty)
{
boolean unseen = codeToDecideIfUnseen();
if(unseen)
p_cell.getTreeTableRow().setStyle("-fx-font-weight:bold");
else
p_cell.getTreeTableRow().setStyle("-fx-font weight:normal");
In addition:
public class MyTableCell extends TreeTableCell