Changeset 5164 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-04-04T23:35:41+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5163 r5164 281 281 282 282 final StringBuilder res = new StringBuilder("<b>"); 283 final String displ = Utils.firstNonNull(locale_display_value, tr(display_value), tr(value)); 284 res.append(displ); 283 res.append(getDisplayValue(true)); 285 284 res.append("</b>"); 286 final String descr = Utils.firstNonNull(locale_short_description, tr(short_description)); 287 if (descr != null) { 285 if (getShortDescription(true) != null) { 288 286 // wrap in table to restrict the text width 289 res.append("<div style=\"width:300px; padding:0 0 5px 5px\">").append(descr).append("</div>"); 287 res.append("<div style=\"width:300px; padding:0 0 5px 5px\">"); 288 res.append(getShortDescription(true)); 289 res.append("</div>"); 290 290 } 291 291 return res.toString(); … … 301 301 public PresetListEntry(String value) { 302 302 this.value = value; 303 } 304 305 public String getDisplayValue(boolean translated) { 306 return translated 307 ? Utils.firstNonNull(locale_display_value, tr(display_value), tr(value)) 308 : Utils.firstNonNull(display_value, value); 309 } 310 311 public String getShortDescription(boolean translated) { 312 return translated 313 ? Utils.firstNonNull(locale_short_description, tr(short_description)) 314 : short_description; 303 315 } 304 316 … … 569 581 int i = 0; 570 582 for (PresetListEntry e : lhm.values()) { 571 display_array[i++] = e. display_value;583 display_array[i++] = e.getDisplayValue(true); 572 584 } 573 585 } … … 780 792 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 781 793 // selected osm primitives are untagged or filling default feature is enabled 782 combo.setSelectedItem(lhm.get(def). display_value);794 combo.setSelectedItem(lhm.get(def).getDisplayValue(true)); 783 795 } else { 784 796 // selected osm primitives are tagged and filling default feature is disabled
Note:
See TracChangeset
for help on using the changeset viewer.