Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 151294 - Inability to persist column sorting
Inability to persist column sorting
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Outline&TreeTable
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Jiri Rechtacek
issues@platform
:
Depends on:
Blocks: 136658
  Show dependency treegraph
 
Reported: 2008-10-24 15:20 UTC by Martin Entlicher
Modified: 2009-02-19 22:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2008-10-24 15:20:44 UTC
In TTV we used "SortingColumnTTV" and "DescendingOrderTTV" properties to set sorting programmatically because of
persistence. In Outline we did not find similar functionality.

ETableColumn has public methods isSorted(), getSortRank() and isAscending(), but corresponding setSorted(),
setSortRank() and setAscending() are package-private.

Also, protected getRowComparator() is impossible to override for us, because instance of protected class OutlineColumn
is created through protected Outline.createColumn(int), which we can not override, because that method is already
overriden in a private class OutlineViewOutline, returning implementation of private class OutlineViewOutlineColumn.

I consider this to be a design mistake to hide these protected methods this way. We might want to override e.g.
isSortingAllowed() and especially the getRowComparator() to define comparator for integers for instance. Now we must use
a hack to prepend numbers with spaces to get correct numerical sorting through alphabetical one.
Comment 1 Stanislav Aubrecht 2008-12-08 16:24:11 UTC
reassigning to new component owner
Comment 2 Jiri Rechtacek 2009-01-09 13:38:03 UTC
> In TTV we used "SortingColumnTTV" and "DescendingOrderTTV" properties to 
> set sorting programmatically because of
> persistence. In Outline we did not find similar functionality.
> 
> ETableColumn has public methods isSorted(), getSortRank() and 
> isAscending(), but corresponding setSorted(),
> setSortRank() and setAscending() are package-private.
I made it public.

> Also, protected getRowComparator() is impossible to override for us, 
> because instance of protected class OutlineColumn
> is created through protected Outline.createColumn(int), which we can not 
> override, because that method is already
> overriden in a private class OutlineViewOutline, returning 
> implementation of private class OutlineViewOutlineColumn.
That's true.

> I consider this to be a design mistake to hide these protected methods 
> this way. We might want to override e.g.
> isSortingAllowed()
I'll solve it later.

> and especially the getRowComparator() to define 
> comparator for integers for instance. Now we must use
> a hack to prepend numbers with spaces to get correct numerical sorting 
> through alphabetical one.
No need to solve it in this way. Outline uses j.l.Comparable interface to order rows. If column's class is Integer, will
sorted naturally as numbers. For own order you can wrap Integer to YourInteger class and define own comparator.

Fixed in rev/13b0821dda4a
Comment 3 Quality Engineering 2009-01-11 06:34:03 UTC
Integrated into 'main-golden', will be available in build *200901110304* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/13b0821dda4a
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #151294: Inability to persist column sorting


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo