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.
Overview: --------- If the ETable.getColumnDisplayName(String) method is overwritten to convert column names to localized strings, the ETable will not display the translated value for a single sorted column. Unsorted columns display the translated value, also if you sort more than one column, the translated values are displayed correctly. This only happens if you sort by a single column. Steps to reproduce: ------------------- 1) Create your own class which extends from ETable. Overwrite the getColumnDisplayName(String) method to convert column names to localized strings. 2) Embed your ETable in a GUI and click on a column to sort it. Actual Results: --------------- The sorted column (which is now bold and contains a sort arrow) will now display the 'technical' column name instead of the localized one. NOTE: If you sort more than one column (by holding shift while clicking on a second column), the column names are displayed correctly again. Expected Results: ----------------- The sorted column should also display the localized value returned by ETable.getColumnDisplayName(String) Build Date & Platform: ---------------------- Product Version: NetBeans IDE 7.0 (Build 201104080000) Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02 System: Linux version 2.6.32-30-generic running on i386; UTF-8; en_US (nb) Additional Information: ----------------------- The behaviour seems to occur due to an unhandled case in the ETableColumn.ETableHeaderRenderer class (http://hg.netbeans.org/main/file/4d131b1ab21b/o.n.swing.outline/src/org/netbeans/swing/etable/ETableColumn.java) on line 606. If the 'sortRank' of the column is not 0, but 'sortedColumns.size()' is 1 (which is true since this bug occurs if only one column is sorted), we do not call 'label.setText(valueString);' which would set the internationalized value, but leave the current label value which was filled by the headerRenderer and therefore is set to the untranslated value.
Created attachment 109611 [details] Small maven project to reproduce the bug
Thanks for the detailed description.
Fixed by changeset: 202366:38761e5bc06f http://hg.netbeans.org/main/rev/38761e5bc06f
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/38761e5bc06f User: mentlicher@netbeans.org Log: #200360 Show localized names of sorted columns.