What's new

Table not displaying until clicked when a CellPainterWrapper instead of a TextPainter for columns


Active member
Staff member
I would like to add dynamic icons to column headers. To do this I've created a class that extends CellPainterWrapper and added a CellPainterDecorator with a TextPainter as the base painter and my dynamic icon painter as the decorator painter.

If I then swap the CELL_PAINTER in the config to use my class instead of the TextPainter the table doesn't display. If I click on where a row should be it then resizes and displays the table as expected with the column header text and icons. I've also tried using the SortableHeaderTextPainter and get the same issue occur.

configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new SortableHeaderTextPainter(),
DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);

Overall this means there is something different with how TextPainter and SortableHeaderTextPainter is implemented. In particular I can see parts in TextPainter that will call commands to resize the layer but I'm struggling to figure out how this should be done.

What needs to be added for it to set the initial column/row sizes?

Continue reading...