Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Paint problem with two level column groups and custom cell painters
Paint problem with two level column groups and custom cell painters [message #1025286] Tue, 26 March 2013 06:27 Go to next message
Andreas Glauner is currently offline Andreas Glauner
Messages: 2
Registered: March 2013
Junior Member
Hi,

I am experiencing some unwanted behavior when using two level column groups along with custom cell painters for the column (group) headers.

Using the _001_Two_level_column_groups example as a basis, I added custom painters to the column header and column header group regions:
final PaddingDecorator paddedTextPainter = new PaddingDecorator(new TextPainter(), 5, 10, 5, 5);
final ICellPainter colHeaderPainter = new BeveledBorderDecorator(paddedTextPainter);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, colHeaderPainter,DisplayMode.NORMAL, GridRegion.COLUMN_GROUP_HEADER);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, colHeaderPainter,DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);

The resulting table does not resize the column header rows (for headers with two groups) properly and cuts off the bottom of the text.

Is there anything wrong about this approach or is this a NatTable issue?
Re: Paint problem with two level column groups and custom cell painters [message #1027080 is a reply to message #1025286] Tue, 26 March 2013 10:31 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1263
Registered: July 2012
Senior Member
The TextPainter does not automatically resize the row height. If you want to achieve such behaviour, you need to tell the TextPainter to calculate its height. Have a look at the various constructors to see the different configuration possibilities.
Re: Paint problem with two level column groups and custom cell painters [message #1027088 is a reply to message #1027080] Tue, 26 March 2013 10:40 Go to previous messageGo to next message
Andreas Glauner is currently offline Andreas Glauner
Messages: 2
Registered: March 2013
Junior Member
Forgot to mention this. I already tried it with the calculate flag on the inner text painter set to true.
The result was that the lowermost row in the column header was painted correctly, while the upper two rows still had their content cut off.
Re: Paint problem with two level column groups and custom cell painters [message #1027140 is a reply to message #1027088] Tue, 26 March 2013 11:46 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1263
Registered: July 2012
Senior Member
Yes that was a bug in 0.9.0 and should be fixed with 1.0.0. At least as far as I know. Otherwise please file a bug. It would also be nice to have a small example showing the issue so we can reproduce and fix it.
Previous Topic:Automatic scroll to last row?
Next Topic:Want to try out NatTable 1.0.0?
Goto Forum:
  


Current Time: Sat Aug 30 22:34:08 EDT 2014

Powered by FUDForum. Page generated in 0.01687 seconds