Fwd: please update FAQ re SortedList+TableComparatorChooser default order

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: please update FAQ re SortedList+TableComparatorChooser default order

Rob Eden
Could someone else verify this change? I don't do a lot with table sorting. If it checks out, I'll change it on the Wiki.

Rob

---------- Forwarded message ----------
From: arghman <[hidden email]>
Date: Wed, Feb 17, 2010 at 9:05 AM
Subject: Re: please update FAQ re SortedList+TableComparatorChooser default order
To: [hidden email]




Rob Eden wrote:
>
> I'm happy to update it. Would you mind jotting down how you think it
> should
> read?
How about something like:

Q: How do I set the default sort column on my JTable?
   A1: Use AbstractTableComparatorChooser.fromString(). [link to javadoc]
   A2: Add an additional SortedList upstream in the EventList pipeline
which sets the default sort order. Before the user selects a sort column,
the downstream SortedList will be "unsorted" and will leave the upstream
SortedList's output untouched. SortedLists provide stable sorting [link to
wikipedia entry?], so this approach has the advantage of providing a
secondary sort to break ties in the downstream SortedList, e.g. in a list of
Person objects containing names and ages, if the upstream SortedList sorts
on name, and the downstream SortedList is controlled by the
TableComparatorChooser, then before any sort headings are selected, the
resultant list will be sorted by name from the upstream SortedList; if the
user then selects "age" and there are 10 people with age 42, within that age
group they will be sorted by name. This approach has the disadvantage of
requiring additional processing within the EventList pipeline

For some additional context see these messages from the mailing list:
View this message in context: http://old.nabble.com/please-update-FAQ-re-SortedList%2BTableComparatorChooser-default-order-tp27556005p27625073.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: please update FAQ re SortedList+TableComparatorChooser default order

James Lemieux
We should be careful of our wording here. "Default" sort and "Initial" sort are probably best defined as separate things.

I think of "default sort" as the sort in play when the table displays no sorting icons. That implies to me the "stacked SortedLists" solution he mentions.

I think of "initial sort" as a way of getting the table to show a sorting icon indicating the sort with which it was initialized. That implies the TableComparatorChooser.fromString(...) solution he mentions, as well as TableComparatorChooser.appendComparator(...) (mentioned in one of the linked defects).

James

On Fri, Feb 19, 2010 at 10:39 AM, Rob Eden <[hidden email]> wrote:
Could someone else verify this change? I don't do a lot with table sorting. If it checks out, I'll change it on the Wiki.

Rob


---------- Forwarded message ----------
From: arghman <[hidden email]>
Date: Wed, Feb 17, 2010 at 9:05 AM
Subject: Re: please update FAQ re SortedList+TableComparatorChooser default order
To: [hidden email]




Rob Eden wrote:
>
> I'm happy to update it. Would you mind jotting down how you think it
> should
> read?
How about something like:

Q: How do I set the default sort column on my JTable?
   A1: Use AbstractTableComparatorChooser.fromString(). [link to javadoc]
   A2: Add an additional SortedList upstream in the EventList pipeline
which sets the default sort order. Before the user selects a sort column,
the downstream SortedList will be "unsorted" and will leave the upstream
SortedList's output untouched. SortedLists provide stable sorting [link to
wikipedia entry?], so this approach has the advantage of providing a
secondary sort to break ties in the downstream SortedList, e.g. in a list of
Person objects containing names and ages, if the upstream SortedList sorts
on name, and the downstream SortedList is controlled by the
TableComparatorChooser, then before any sort headings are selected, the
resultant list will be sorted by name from the upstream SortedList; if the
user then selects "age" and there are 10 people with age 42, within that age
group they will be sorted by name. This approach has the disadvantage of
requiring additional processing within the EventList pipeline

For some additional context see these messages from the mailing list:
View this message in context: http://old.nabble.com/please-update-FAQ-re-SortedList%2BTableComparatorChooser-default-order-tp27556005p27625073.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: please update FAQ re SortedList+TableComparatorChooser default order

hbrands
Administrator
I agree with James.
So, what should we do?
Make two related FAQ entries?

With regard to the "default sort":
Should we consider adding support for this in TableComparatorChooser as James and Kevin
suggested on the user list some time ago?

Holger

2010/2/19 James Lemieux <[hidden email]>
We should be careful of our wording here. "Default" sort and "Initial" sort are probably best defined as separate things.

I think of "default sort" as the sort in play when the table displays no sorting icons. That implies to me the "stacked SortedLists" solution he mentions.

I think of "initial sort" as a way of getting the table to show a sorting icon indicating the sort with which it was initialized. That implies the TableComparatorChooser.fromString(...) solution he mentions, as well as TableComparatorChooser.appendComparator(...) (mentioned in one of the linked defects).

James


On Fri, Feb 19, 2010 at 10:39 AM, Rob Eden <[hidden email]> wrote:
Could someone else verify this change? I don't do a lot with table sorting. If it checks out, I'll change it on the Wiki.

Rob


---------- Forwarded message ----------
From: arghman <[hidden email]>
Date: Wed, Feb 17, 2010 at 9:05 AM
Subject: Re: please update FAQ re SortedList+TableComparatorChooser default order
To: [hidden email]




Rob Eden wrote:
>
> I'm happy to update it. Would you mind jotting down how you think it
> should
> read?
How about something like:

Q: How do I set the default sort column on my JTable?
   A1: Use AbstractTableComparatorChooser.fromString(). [link to javadoc]
   A2: Add an additional SortedList upstream in the EventList pipeline
which sets the default sort order. Before the user selects a sort column,
the downstream SortedList will be "unsorted" and will leave the upstream
SortedList's output untouched. SortedLists provide stable sorting [link to
wikipedia entry?], so this approach has the advantage of providing a
secondary sort to break ties in the downstream SortedList, e.g. in a list of
Person objects containing names and ages, if the upstream SortedList sorts
on name, and the downstream SortedList is controlled by the
TableComparatorChooser, then before any sort headings are selected, the
resultant list will be sorted by name from the upstream SortedList; if the
user then selects "age" and there are 10 people with age 42, within that age
group they will be sorted by name. This approach has the disadvantage of
requiring additional processing within the EventList pipeline

For some additional context see these messages from the mailing list:
View this message in context: http://old.nabble.com/please-update-FAQ-re-SortedList%2BTableComparatorChooser-default-order-tp27556005p27625073.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]