GlazedLists with two Comparators per column

56 Views Asked by At

I would like to know if somebody already did the effort to integrate the following into GlazedLists:

I want a separate Comparator for each sort direction of a column. A practical example for something like this is a file browser where the directories are always sorted to the front and only as secondary sorting requirement, I want to sort by the file/directory name. If i have only one Comparator, this is of course not possible.

I also just realized that it might exist also a workaround if I use sorting by multiple columns and the main sorting priority is on the column that says whether some element is a file or directory.

Does anyone have experience with this issue?

Thanks.

1

There are 1 best solutions below

0
On

Ok, it seems I still did not unleash the full power of GlazedLists when I asked the question. The answer is very simple: I can just add another SortedList that sorts by file types as decorator of my initial SortedList that is sorted based on the table.