Changeset 16283 in josm
- Timestamp:
- 2020-04-12T23:25:37+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
r15501 r16283 27 27 import org.openstreetmap.josm.tools.I18n; 28 28 import org.openstreetmap.josm.tools.Pair; 29 import org.openstreetmap.josm.tools.Utils; 29 30 30 31 /** … … 112 113 } 113 114 } 114 boolean knownNameKey= false;115 boolean enableHTML = false; 115 116 if (column == 0 && str != null) { 116 117 Pair<String, Boolean> label = I18n.getLocalizedLanguageName(str); 117 if (label != null) { 118 knownNameKey = label.b; 119 if (knownNameKey) { 120 str = new StringBuilder("<html><body>").append(str) 121 .append(" <i><").append(label.a).append("></i></body></html>").toString(); 122 } 118 if (label != null && label.b) { 119 enableHTML = true; 120 str = "<html><body>" + str + " <i><" + label.a + "></i></body></html>"; 123 121 } 122 } else if (column == 1 && str != null && String.valueOf(table.getModel().getValueAt(row, 0)).contains("colour")) { 123 enableHTML = true; 124 // U+25A0 BLACK SQUARE 125 String escaped = Utils.escapeReservedCharactersHTML(str); 126 str = "<html><body><span color='" + escaped + "'>\u25A0</span> " + escaped + "</body></html>"; 124 127 } 125 ((JLabel) c).putClientProperty("html.disable", knownNameKey? null : Boolean.TRUE); // Fix #8730128 ((JLabel) c).putClientProperty("html.disable", enableHTML ? null : Boolean.TRUE); // Fix #8730 126 129 ((JLabel) c).setText(str); 127 130 if (DISCARDABLE.get()) {
Note:
See TracChangeset
for help on using the changeset viewer.