This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 106355 [details] 0 shall remove the EColumn from sorted list First and foremost: what is the right way to sort outline view columns programaticaly? There is ETableColumn.setRank, setAscending, etc. just calling those has no meaning! Some of the methods there are deprecated, but they don't point to the proper way to do it. At the end we ended up with outlineView.getOutline().getColumnModel().clearSortedColumns(); outlineView.getOutline().getColumnModel().setColumnSorted(...); outlineView.getOutline().tableChanged(new TableModelEvent(getModel(), 0, getModel().getRowCount())); c'mon! Do you really mean this is the proper usage? If not, please change javadoc of these methods to point to the right method to use, thanks! In addition to that I am attaching patch showing that the behaviour of the uses the API according to javadoc and generates java.lang.IndexOutOfBoundsException. I am making the bug P2 for violation of the API contract, but the fix of the documentation would be welcomed too.
The correct approach is to use ETable.setColumnSorted(). I've adjusted the documentation of ETable.setColumnSorted() and ETableColumnModel.setColumnSorted(). Also, I've fixed the IndexOutOfBoundsException and refresh of the UI. Fixed by changeset: 189979:511ceb053bf2 http://hg.netbeans.org/main/rev/511ceb053bf2
Created attachment 106658 [details] Modified test that I've used to verify the sorting functionality.
Integrated into 'main-golden', will be available in build *201103040000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/511ceb053bf2 User: mentlicher@netbeans.org Log: #195884 Make the setColumnSorted() method to work properly.