Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Custom Painter in multi level header(Not able to set configuration for second header)
Custom Painter in multi level header [message #1090914] Tue, 20 August 2013 20:43 Go to next message
Artyom Karalov is currently offline Artyom KaralovFriend
Messages: 15
Registered: August 2013
Location: Israel
Junior Member
Hi.
I built 3 level header row.
In lowest level only I want to use vertical text painter.
Unfortunately it is applied to second level header as well and I am not able to override it (looks like second header responds to GridRegion.COLUMN_HEADER rather than GridRegion.COLUMN_GROUP_HEADER). Is there way / workaround to set configuration for intermediate levels?

...
ColumnGroupBodyLayerStack bodyLayer = new ColumnGroupBodyLayerStack(bodyDataLayer, columnGroupModel) {};           
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(new DefaultColumnHeaderDataLayer(columnHeaderDataProvider), bodyLayer, bodyLayer.getSelectionLayer(), false);        
ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(columnHeaderLayer, bodyLayer.getSelectionLayer(), columnGroupModel, false);
ColumnGroupGroupHeaderLayer columnGroupGroupHeaderLayer = new ColumnGroupGroupHeaderLayer(columnGroupHeaderLayer, bodyLayer.getSelectionLayer(), columnGroupGroupModel, false);

columnGroupGroupHeaderLayer.addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
    {
        this.cellPainter = new BeveledBorderDecorator(new VerticalTextPainter(false, true, true, true));
    }
            
    @Override
    public void configureRegistry(IConfigRegistry configRegistry) {
        super.configureRegistry(configRegistry);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new BeveledBorderDecorator(new TextPainter()), DisplayMode.NORMAL, GridRegion.COLUMN_GROUP_HEADER);
    }
});
...
Re: Custom Painter in multi level header [message #1091522 is a reply to message #1090914] Wed, 21 August 2013 16:13 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1407
Registered: July 2012
Senior Member
Try to register custom labels and configure the text painters against them
Re: Custom Painter in multi level header [message #1091625 is a reply to message #1090914] Wed, 21 August 2013 19:19 Go to previous messageGo to next message
Artyom Karalov is currently offline Artyom KaralovFriend
Messages: 15
Registered: August 2013
Location: Israel
Junior Member
I could not attach labels to second header since LabelAccumulator is called for 2 rows only (0 and -1). When I tried to attach labels to any of these rows I either affected top or bottom header, but not middle one. The second header row is always painted same as bottom.
Re: Custom Painter in multi level header [message #1091673 is a reply to message #1091625] Wed, 21 August 2013 21:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1407
Registered: July 2012
Senior Member
Hm, well the column grouping stuff is something that definitely needs to be completely refactored.

But I don't understand why the label accumulator is only called for 2 rows. That might be the issue.
Re: Custom Painter in multi level header [message #1091912 is a reply to message #1091673] Thu, 22 August 2013 05:18 Go to previous message
Artyom Karalov is currently offline Artyom KaralovFriend
Messages: 15
Registered: August 2013
Location: Israel
Junior Member
Thanks for support.
For now I will remove 3rd header and hope to add it back in future releases.
Previous Topic:Automatic row resizing
Next Topic:Expected date of next release or patch
Goto Forum:
  


Current Time: Wed Nov 26 17:52:42 GMT 2014

Powered by FUDForum. Page generated in 0.02787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software