Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ColumGroupHeader-Styling Issue
ColumGroupHeader-Styling Issue [message #1801826] Mon, 28 January 2019 06:44 Go to next message
Mathias Jankow is currently offline Mathias JankowFriend
Messages: 5
Registered: May 2017
Junior Member
Hi,

i have a table with a GroupColumn (2-Layers) and i want to style both layers the same. I apply the styling to the ColumnHeaderConfiguration which works fine but the ColumnGroupHeaderConfiguration is untouched by this (see attachment).

When i initialize the ColumnGroupHeaderLayer a DefaultColumnGroupHeaderLayerConfiguration gets applied with it. In there the following code-snippet gets applied:

@Override
    public void configureRegistry(IConfigRegistry configRegistry) {
        configRegistry.registerConfigAttribute(
                CellConfigAttributes.CELL_PAINTER,
                new BeveledBorderDecorator(new ColumnGroupHeaderTextPainter()),
                DisplayMode.NORMAL,
                GridRegion.COLUMN_GROUP_HEADER);
        // We are not setting a special configuration for rendering grid lines,
        // as this would override the column header configuration. This is
        // because the the column group header is part of the column header
        // region.
    }


What i did is write a CustomColumnGroupHeaderLayerConfiguration which extends the DefaultColumnGroupHeaderLayerConfiguration with my own styling.

This doesn't seem right though :)
Can i access the configRegistry for the DefaultColumnGroupHeaderLayerConfiguration easier and just overwrite the DefaultConfiguraiton somewhere without using a new Custom-Class ? Is there a way to automatically apply the ColumnHeaderConfiguration to the GroupColumnHeaderConfiguration ?

thanks in advance.
Re: ColumGroupHeader-Styling Issue [message #1801828 is a reply to message #1801826] Mon, 28 January 2019 07:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
This doesn't seem right though :)


Why does that not seem right for your?

You can always access the ConfigRegistry directly. But this is not the recommended way. Writing a custom configuration class is best practice. That is why the default configuration is prefixed with "Default". If you need a different behavior in styling or whatever, write your own configuration. Just ensure that you create the ColumnGroupHeaderLayer with useDefaultConfiguration == false and then register your custom configuration afterwards via addConfiguration()
Re: ColumGroupHeader-Styling Issue [message #1801839 is a reply to message #1801828] Mon, 28 January 2019 10:00 Go to previous message
Mathias Jankow is currently offline Mathias JankowFriend
Messages: 5
Registered: May 2017
Junior Member
Thanks for the quick reply.

I just thought there was some way to apply all the styling-configurations from the ColumnHeaderConfiguration automatically to the ColumnGroupHeaderConfig which i just did not find/see yet.

Thanks again !
Previous Topic:How to disable the empty vertical scrollbar painting
Next Topic:NatTable version 1.1.0 and Glazelist version 1.8.0 compatibility
Goto Forum:
  


Current Time: Tue Apr 16 19:54:15 GMT 2024

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

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

Back to the top