« Return to Thread: EventListJXTableSorting

Re: EventListJXTableSorting

by James Lemieux :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
1. A SortedList does not impose an order on its source EventList until it has been given a Comparator. A Comparator can either be given in the constructor or given using setComparator(). So if you are passing a Comparator-less SortedList into your EventTableModel then NO sorting will occur.

2. Jesse needs to weigh in on EventListJXTableSorting since he authored it.

3. If your FilterList is not behaving correctly then either
   a) your Matcher logic isn't doing the right thing
   b) your MatcherEditor (if any) is firing the wrong kind of MatcherEditor.Event because you are calling the fire method. i.e. make sure you're calling fireConstrained, fireRelaxed, etc at the appropriate times.

4. The best way for me to make headway on your EventListJXTableSorting bug is for you to produce a test class that demonstrates it. I can promise a speedy resolution if you can do that.

James


On 7/27/07, Steve Newell <newellista@... > wrote:

Actually, my list IS initially sorted, which is what I expected.  I thought
that since I was passing the sortedList to my EventTableModel, it would sort
initially.  Is that not correct?

My application creates a list of images and displays them in the JXTable.  I
would like the image list to be sorted by size initially.  That is what
happens when I don't call EventListJXTableSorting.install( ... ).

Also, if I add a FilterList to the table, everything appears to work until I
change the filter.  Once the I change the filter, I only get one entry, no
matter what else I try.



James Lemieux wrote:
>
> Steve,
>
>    I'm unsure of what your exact problem is. In GL, tables stay unsorted
> until you click on the header once. We don't have the concept of a default
> table order (yet). What is incorrect about not sorting the table until the
> header is clicked?
>
> James
>

> On 7/25/07, Steve Newell <newellista@...> wrote:
>>
>> I am attempting to create a table using JXTable and glazedLists.  My
>> problem is the sorting.  Things seem to work fine UNLESS I call
>> EventListJXTableSorting.install( imageTable, sortedList );
>>
>> When I add that call, the table is not sorted until I select one of the
>> headers.
>>
>> Here is the method that creates the table:
>>
>> private JScrollPane getFilteredList()
>> {
>>  JScrollPane scrollImageTable = null;
>>
>>
>>  imageList.getReadWriteLock().writeLock().lock();
>>  try
>>  {
>>  SortedList< ImageSignature > sortedList = new SortedList< ImageSignature
>> >( imageList, new ImageSizeComparator() );
>>  EventTableModel< ImageSignature > tableModel = new EventTableModel<
>> ImageSignature >( sortedList, new ImageTableFormat() );
>>  JXTable imageTable = new DroppableTable( tableModel );
>>
>>  EventListJXTableSorting sorting = EventListJXTableSorting.install (
>> imageTable, sortedList );
>>  sorting.setMultipleColumnSort( false );
>>
>>  scrollImageTable = new JScrollPane( imageTable );
>>
>>  imageTable.setHighlighters(
>> HighlighterFactory.createAlternateStriping(),

>> new RolloverHighlighter( Color.BLACK, Color.white ) );
>>  imageTable.setRolloverEnabled( true );
>>  imageTable.setHorizontalScrollEnabled ( true );
>>
>>  imageTable.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
>>  imageTable.setColumnControlVisible( true );
>>
>>
>>  TableSelectionListener selectionListener = new TableSelectionListener(
>> imageTable );
>>  imageTable.getSelectionModel().addListSelectionListener(
>> selectionListener );
>>  }
>>  finally
>>  {
>>  imageList.getReadWriteLock ().writeLock().unlock();
>>  }
>>
>>
>>  return scrollImageTable;
>> }
>>
>
>

--
View this message in context: http://www.nabble.com/EventListJXTableSorting-tf4148508.html#a11834765
Sent from the GlazedLists - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


 « Return to Thread: EventListJXTableSorting