Skip to main content



      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 11:33 Go to next message
Eclipse UserFriend
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 11:43] by Moderator

Re: Problem with Column Group Reorder and Column Grouping by Value [message #1799624 is a reply to message #1799426] Tue, 11 December 2018 08:06 Go to previous messageGo to next message
Eclipse UserFriend
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 14:34 Go to previous message
Eclipse UserFriend
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: Wed May 21 10:21:18 EDT 2025

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

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

Back to the top