Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 580971

Summary: Accumulate sorting columns changes sort sequence
Product: [Technology] NatTable Reporter: Dirk Fauth <dirk.fauth>
Component: GlazedLists ExtensionAssignee: Dirk Fauth <dirk.fauth>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0.3   
Target Milestone: 2.0.4   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/196575
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=9455fb8fea92055d2deadb29aa974d38a9756422
Whiteboard:

Description Dirk Fauth CLA 2022-11-02 02:22:43 EDT
With the GlazedListsSortModel it is possible to sort by multiple columns. But if you try to change the sort direction of a column that is not the last column that is used for sorting, the column becomes the last in the sort sequence.

For example:

Col1-ASC | Col2-ASC | Col3-ASC

If you now try to change the sort direction of Col2 via accumulation, the result is:

Col1-ASC | Col3-ASC | Col2-DESC

This is from a UX point of view an undesired effect, because only the sort direction should be updated, not the sort sequence.
Comment 1 Eclipse Genie CLA 2022-11-02 02:28:30 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/196575
Comment 3 Dirk Fauth CLA 2022-11-02 02:51:27 EDT
Fixed this by adding an update handling in NatTableComparatorChooser instead of a simple remove and append.

Additionally the SortCommandHandler now checks for existing multi-column selection and if an accumulated sorting should be performed. If that is the case and the column to sort is already sorted and not the last column in the sort sequence, only ASC and DESC are toggled, the sorting can't be removed via accumulate this way now.
Comment 4 Dirk Fauth CLA 2022-12-14 14:57:27 EST
Released with 2.0.4