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.

Bug 200360 - Sorted ETable column doesn't respect ETable.getColumnDisplayName
Summary: Sorted ETable column doesn't respect ETable.getColumnDisplayName
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2011-07-25 14:33 UTC by m.doswald
Modified: 2011-09-21 08:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Small maven project to reproduce the bug (1.97 KB, application/octet-stream)
2011-07-25 17:11 UTC, m.doswald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m.doswald 2011-07-25 14:33:35 UTC
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.
Comment 1 m.doswald 2011-07-25 17:11:39 UTC
Created attachment 109611 [details]
Small maven project to reproduce the bug
Comment 2 Martin Entlicher 2011-09-19 16:40:41 UTC
Thanks for the detailed description.
Comment 3 Martin Entlicher 2011-09-20 09:05:33 UTC
Fixed by changeset:   202366:38761e5bc06f
http://hg.netbeans.org/main/rev/38761e5bc06f
Comment 4 Quality Engineering 2011-09-21 08:07:54 UTC
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.