Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ColumnGroup collapsable even if no ColumnGroupExpandCollapseLayer registered(ColumnGroup is initialized with collapsable = true always. So the expand/collapse icons are always drawn even if no ColumnGroupExpandCollapseLayer is registered.)
ColumnGroup collapsable even if no ColumnGroupExpandCollapseLayer registered [message #1779548] Tue, 09 January 2018 13:50 Go to next message
Michel Pittelkow is currently offline Michel PittelkowFriend
Messages: 8
Registered: October 2017
Junior Member
Hi Dirk :),

I came across the case that the ColumnGroups in the ColumnGroupHeaderLayer got an expand icon even if there is no ColumnGroupExpandCollapseLayer (CGECLayer) registered.

After digging a little bit, ColumnGroup is always initialized with collapseable = true which leads to addition of the label GROUP_EXPANDED_CONFIG_TYPE which then results in the icon to get drawn.

I'd like to create somehow a relation between the CGECLayer and the addition of this Label.

I was thinking about initializing ColumnGroup with collapseable false as default, but this could lead to unwanted behaviour. Second thought was adding a check inside the ColumnGroupHeaderLayer#getConfigLabelsByPosition method if a CGECLayer exists and ColumnGroup is collapsable and only then adding the label.

What is your opinion on this?

Cheers,
Michel
Re: ColumnGroup collapsable even if no ColumnGroupExpandCollapseLayer registered [message #1779553 is a reply to message #1779548] Tue, 09 January 2018 14:35 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
I was thinking about initializing ColumnGroup with collapseable false as default


That is a bad idea as it would have impact on other projects that expect a different behavior. But we could think about an additional constructor where you could specify it. So the ColumnGroupModel could have a member defaultCollapseable which can be set at creation time. And that default is then set to the created ColumnGroup instances.

Quote:
Second thought was adding a check inside the ColumnGroupHeaderLayer#getConfigLabelsByPosition method if a CGECLayer exists and ColumnGroup is collapsable and only then adding the label.


That is a violation of the layer concept. Of course it is an issue in the whole column grouping design that a layer in one region has some dependency to a layer in another region. That is not part of the basic NatTable design. And I would not like to introduce such a dependency.

In my opinion the developer who creates the layer composition and the column groups has a knowledge of the layer stack and therefore knows how to create ColumnGroups. With the above mentioned approach the ColumnGroupModel could have knowledge about the default and create ColumnGroups with that default accordingly.

The whole column grouping needs some sort of refactoring. But I did not have time for that in the past, and it looks like most of the people do not have issues with it.
Re: ColumnGroup collapsable even if no ColumnGroupExpandCollapseLayer registered [message #1779554 is a reply to message #1779553] Tue, 09 January 2018 14:53 Go to previous message
Michel Pittelkow is currently offline Michel PittelkowFriend
Messages: 8
Registered: October 2017
Junior Member
I agree. In the most cases, this would work.

As the project I'm currently working on could be considered huge and we are planning on exchanging nearly all occurences of JFace TableViewer with NatTable, for my approach I need to think about possibilities in the configurations that might occur, even if rare.
This complicates things for me but will improve the ease of use for the developers that need to exchange the tables once the builder is working fine.

I'll give the alternate constructor approach a shot and see how it works. I'll also check for other dependencies of ColumnGroup like in ColumnGroupsCommandHandler and report back.
Previous Topic:Intercepting row header region click actions
Next Topic:Auto resize column by double clicking
Goto Forum:
  


Current Time: Thu Apr 25 14:10:59 GMT 2024

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

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

Back to the top