Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Problem with Column Group Reorder and Column Grouping by Value(Using default configuration, column reorder seems broken)
Problem with Column Group Reorder and Column Grouping by Value [message #1799426] Thu, 06 December 2018 16:33 Go to next message
Yves Prelot is currently offline Yves PrelotFriend
Messages: 13
Registered: September 2016
Junior Member
Hello,

I have found it difficult to configure a table using both Column group reorder and Column grouping by value.

Using the default configuration, the group by feature works well, but the column reorder is broken : groups can be broken into sections and you can move a column which is in a group to another place : it still stays inside the group, but the group itself is broken (instead of being continuous, it is broken into separate segments...)

After a long investigation, I believe there is a conflict between:
DefaultColumnGroupHeaderLayerConfiguration => configureUiBindings

which does what is expected for proper Group Column Reorder

and
GroupByHeaderConfiguration => configureUiBindings

which does what is expected for Column Grouping by Value


I could (almost) do what I wanted by extracting the code for the latter (a simple registerFirstMouseDragMode) and assigning it to a different key (left clisck + MOD2);
this is not very natural but is acceptable.

Is there a smarter way to do this ?


Here is a snipet showing what I did:

groupByHeaderLayer = new GroupByHeaderLayer(groupByModel, gridLayer, columnHeaderDataProvider,
new GroupByHeaderConfiguration(groupByModel, columnHeaderDataProvider, columnHeaderStack.columnHeaderLayer) {
DefaultColumnGroupHeaderLayerConfiguration defaultConf = new DefaultColumnGroupHeaderLayerConfiguration(
columnGroupModel);

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
defaultConf.configureRegistry(configRegistry);
super.configureRegistry(configRegistry);
}

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// everything for columns work here, but column group by
defaultConf.configureUiBindings(uiBindingRegistry);
// add the column group by
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.columnHeaderLeftClick(SWT.MOD2),
new AggregateDragMode(new CellDragMode(), new GroupByColumnReorderDragMode(), new GroupByDragMode()));
}
});


Regards,
Yves

[Updated on: Thu, 06 December 2018 16:43]

Report message to a moderator

Re: Problem with Column Group Reorder and Column Grouping by Value [message #1799624 is a reply to message #1799426] Tue, 11 December 2018 13:06 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
There is a ticket on this already: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395911

The current solution is still to create a custom reorder drag mode that deals with this like you did. I still haven't found a better solution.
Re: Problem with Column Group Reorder and Column Grouping by Value [message #1799640 is a reply to message #1799624] Tue, 11 December 2018 19:34 Go to previous message
Yves Prelot is currently offline Yves PrelotFriend
Messages: 13
Registered: September 2016
Junior Member
Thanks for the reply.

Yves
Previous Topic:How to configure the DefaultSelectionLayerConfiguration
Next Topic:Dynamically set column span for a cell
Goto Forum:
  


Current Time: Sat Apr 20 03:05:51 GMT 2024

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

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

Back to the top