
Some parts of this message have been removed.
Learn more about Nabble's
security policy.
If your ObservableElementList is looking for changes that might change the sort order, then you need to have it come before the SortedList in the pipeline.
OEL fires change notifications downstream in the list. If your OEL is after the SortedList, then no events fired by the OEL will ever hit the Sorted List.
In terms of where to put threadsafelist, etc... it really depends on the behavior you are trying for. If you are inserting/editing elements in the BasicEventList directly, then you'd wrap that. If you are inserting/editing elements in the TreeList, then you'd wrap that.
I'm also not entierly sure that you need to manually include the swingThreadProxyList in the chain - the table model does this automatically (I'm pretty sure on that). If you *did* have to do it manually, you'd want to pick a point in the list where it makes sense for behavior to always be occuring on the EDT (this is generally right at the point where you tie the list chain to a tablemodel or listmodel - but there are certainly situations where different placement may be appropriate).
- K
----------------------- Original Message -----------------------
Cc:
Date: Mon, 13 Oct 2008 05:24:49 -0700 (PDT)
Subject: Re: Sorting TreeList
Thanks for the quick reply!
With regards to the sort comparator used for the sorted list, would I use
the same comparator *TreeFormat (in your example SimpleBeanTreeFormat)?
Also, if the chain of events is:
BasicEventList -> SortedList -> ObservableElementList -> TreeList
At which level would I apply the GlazedListsSwing.swingThreadProxyList() and
the GlazedLists.threadSafeList()? Should I be applying these at the lowest
level (i.e. BasicEventList), or at the highest level (i.e TreeList)?
And one more point with regards to chaining Lists together, is there a
standard way that one list must be chained to the next? Or is it a
free-for-all in the order that you chain lists together?
Cheers!
Ken Orr wrote:
>
> If you add a SortedList upstream of your TreeList, you'll get sorted
> output.
>
> SortedList -> TreeList
>
>
> dingwa wrot
e:
>>
>> Hi,
>>
>> How is it possible to sort TreeLists? When I add rows to the tree list
>> they seem be be inserted into an arbitrary position. I am wanting to
>> control the position of any new rows that are inserted into the TreeList
>> (i.e. at the top of the table)
>>
>> Would I have either have to insert the row into the TreeList and then
>> sort the list so the newly inserted row is at the top? Or is it even
>> possible to insert the top level expandable row at a specified position?
>>
>>
>> Cheers!
>>
>
>
--
View this message in context:
http://www.nabble.com/Sorting-TreeList-tp19919951p19953913.htmlSent from the GlazedLists - User mailing list archive at Nabble.com.
------
---------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@...For additional commands, e-mail:
users-help@...
---------------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@...
For additional commands, e-mail:
users-help@...