My goal is to display a tooltip on cells where the text is truncated at launch, but also during runtime, which means that if a column is resized, some tool tip may appear or dissapear.
In my cell factory, I thought there will be a property that I could bind or listen to, and simply link a tooltip to this, but I found none.
Here's my code that set a tool tip on every cell in the cell factory:
public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null) {
setText(null);
setGraphic(null);
} else {
setText(adapter.getCellContentParser().toString(item));
setTooltip(new Tooltip(this.getText());
}
}
Please note that I look for every possible solution on the site, like these ones : https://stackoverflow.com/questions/15683907/javafx-tableviews-cellvalue-is-not-enough-to-display-in-columns-it-will-be-cl#=
How to show tooltip only on those table cells which text is ellipsized (...)?
And they are perfectly fine when you launch your program, but don't work when you resizing your columns.
Is there something I'm missing ? I find it really strange that there is not an observableproperty for this kind of thing.