- Timestamp:
- 2020-03-06T00:23:33+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
r16042 r16043 30 30 */ 31 31 public Combo() { 32 delimiter = ",";32 delimiter = ','; 33 33 } 34 34 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r16042 r16043 90 90 * In case of {@link MultiSelect} the default is semicolon and this will also be used to separate selected values in the tag. 91 91 */ 92 public String delimiter = ";"; // NOSONAR92 public char delimiter = ';'; // NOSONAR 93 93 /** whether the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".*/ 94 94 public String use_last_as_default = "false"; // NOSONAR … … 158 158 */ 159 159 protected static class ConcatenatingJList extends JList<PresetListEntry> { 160 private final Stringdelimiter;161 162 protected ConcatenatingJList( Stringdel, PresetListEntry... o) {160 private final char delimiter; 161 162 protected ConcatenatingJList(char del, PresetListEntry... o) { 163 163 super(o); 164 164 delimiter = del; … … 170 170 } else { 171 171 String s = o.toString(); 172 Set<String> parts = new TreeSet<>(Arrays.asList(s.split( delimiter)));172 Set<String> parts = new TreeSet<>(Arrays.asList(s.split(String.valueOf(delimiter)))); 173 173 ListModel<PresetListEntry> lm = getModel(); 174 174 int[] intParts = new int[lm.getSize()]; … … 351 351 protected abstract void addToPanelAnchor(JPanel p, String def, boolean presetInitiallyMatches); 352 352 353 protected char getDelChar() {354 return delimiter.isEmpty() ? ';' : delimiter.charAt(0);355 }356 357 353 @Override 358 354 public Collection<String> getValues() { … … 423 419 424 420 private void initListEntriesFromAttributes() { 425 char delChar = getDelChar();426 421 427 422 String[] valueArray = null; … … 450 445 451 446 if (valueArray == null) { 452 valueArray = splitEscaped(del Char, values);447 valueArray = splitEscaped(delimiter, values); 453 448 } 454 449 … … 456 451 if (!values_no_i18n) { 457 452 final String displ = Utils.firstNonNull(locale_display_values, display_values); 458 displayArray = displ == null ? valueArray : splitEscaped(del Char, displ);453 displayArray = displ == null ? valueArray : splitEscaped(delimiter, displ); 459 454 } 460 455 461 456 final String descr = Utils.firstNonNull(locale_short_descriptions, short_descriptions); 462 String[] shortDescriptionsArray = descr == null ? null : splitEscaped(del Char, descr);457 String[] shortDescriptionsArray = descr == null ? null : splitEscaped(delimiter, descr); 463 458 464 459 if (displayArray.length != valueArray.length) { -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r15902 r16043 126 126 if (boolean.class.equals(klass)) 127 127 return parseBoolean(value); 128 else if (char.class.equals(klass)) 129 return value.charAt(0); 128 130 else if (Integer.class.equals(klass)) 129 131 return Integer.valueOf(value); … … 154 156 } 155 157 if (f != null && Modifier.isPublic(f.getModifiers()) && ( 156 String.class.equals(f.getType()) || boolean.class.equals(f.getType()) || 158 String.class.equals(f.getType()) || boolean.class.equals(f.getType()) || char.class.equals(f.getType()) || 157 159 Float.class.equals(f.getType()) || Double.class.equals(f.getType()) || 158 160 Long.class.equals(f.getType()) || Integer.class.equals(f.getType()))) {
Note:
See TracChangeset
for help on using the changeset viewer.