- Timestamp:
- 2018-08-27T19:41:11+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
r14174 r14185 112 112 c.setFont(c.getFont().deriveFont(Font.ITALIC)); 113 113 114 } else { // One value: display the value 115 final Map.Entry<?, ?> entry = v.entrySet().iterator().next(); 116 str = (String) entry.getKey(); 114 } else { // One value: display the value 115 str = (String) v.entrySet().iterator().next().getKey(); 117 116 } 118 117 } 118 boolean knownNameKey = false; 119 119 if (column == 0 && str != null) { 120 120 Matcher m = LANGUAGE_NAMES.matcher(str); … … 122 122 String code = m.group(1); 123 123 String label = new Locale(code).getDisplayLanguage(); 124 if (!code.equals(label)) { 125 str = new StringBuilder(str).append(" <").append(label).append('>').toString(); 124 knownNameKey = !code.equals(label); 125 if (knownNameKey) { 126 str = new StringBuilder("<html><body>").append(str) 127 .append(" <i><").append(label).append("></i></body></html>").toString(); 126 128 } 127 129 } 128 130 } 129 ((JLabel) c).putClientProperty("html.disable", Boolean.TRUE); // Fix #8730131 ((JLabel) c).putClientProperty("html.disable", knownNameKey ? null : Boolean.TRUE); // Fix #8730 130 132 ((JLabel) c).setText(str); 131 133 if (DISCARDABLE.get()) {
Note:
See TracChangeset
for help on using the changeset viewer.