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 217866 - ColumnSelectionPanel not always using ETable.getColumnDisplayName to localise headers
Summary: ColumnSelectionPanel not always using ETable.getColumnDisplayName to localise...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2012-09-05 08:51 UTC by aehgts
Modified: 2013-01-10 03:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to ensure column names are always given the chance to be localised (1004 bytes, patch)
2012-09-05 08:51 UTC, aehgts
Details | Diff
Simple test class to show that the column headers are inconsistently localised (1.06 KB, text/x-java)
2012-09-06 02:22 UTC, aehgts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aehgts 2012-09-05 08:51:27 UTC
Created attachment 123929 [details]
Patch to ensure column names are always given the chance to be localised

ColumnSelectionPanel has a few modes of operation and they inconsistently localise the column headers.

When using a custom TableColumnSelector, the column names are generated using the static getAvailableColumnNames() method.

When using the default (null) TableColumnSelector, an instance of ColumnSelectionPanel is created and its layoutPanel() method uses the raw result of an ETableColumn's getHeaderValue().toString().
This happens in both layoutPanel() and showColumnSelectionPopup().


In my use case, I am overriding getColumnDisplayNames() to make use of a resource bundle to localise my column headers. Without creating my own TableColumnSelector I see localised headers in the table but see bundle keys in the column selector.

I propose wrapping the two lines where the raw column header's toString() result is used with ETable.getColumnDisplayName().  See the attached patch.
Comment 1 aehgts 2012-09-06 02:22:33 UTC
Created attachment 123972 [details]
Simple test class to show that the column headers are inconsistently localised

Attached 'ColumnSelectionPanelTest.java' as a simple test case showing the issue.

Run with org-netbeans-swing-outline-RELEASE72.jar on the class path.
Right click on any column header and note the ColumnSelectionPanel is showing different header text than the table.
Comment 2 Martin Entlicher 2013-01-09 07:54:22 UTC
Thanks for the detailed description and patch.
Fixed by changeset:   244200:89b0a46e946a
http://hg.netbeans.org/core-main/rev/89b0a46e946a
Comment 3 Quality Engineering 2013-01-10 03:33:53 UTC
Integrated into 'main-golden', will be available in build *201301100107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/89b0a46e946a
User: mentlicher@netbeans.org
Log: #217866: Call ETable.getColumnDisplayName() to retrieve the localized column names.