Changeset 4656 in josm for trunk/src/org
- Timestamp:
- 2011-12-12T13:37:20+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r4635 r4656 1344 1344 } 1345 1345 public void visit(ListListSetting setting) { 1346 changed = putArray(key, (Collection) setting.getValue()); 1346 @SuppressWarnings("unchecked") 1347 boolean changed = putArray(key, (Collection) setting.getValue()); 1348 this.changed = changed; 1347 1349 } 1348 1350 public void visit(MapListSetting setting) { … … 1465 1467 properties.put(parser.getAttributeValue(null, "key"), parser.getAttributeValue(null, "value")); 1466 1468 jumpToEnd(); 1467 } else if (parser.getLocalName().equals("list") || parser.getLocalName().equals("collection")) { 1469 } else if (parser.getLocalName().equals("list") || 1470 parser.getLocalName().equals("collection") || 1471 parser.getLocalName().equals("lists") || 1472 parser.getLocalName().equals("maps") 1473 ) { 1468 1474 parseToplevelList(); 1469 1475 } else { … … 1489 1495 protected void parseToplevelList() throws XMLStreamException { 1490 1496 String key = parser.getAttributeValue(null, "key"); 1497 String name = parser.getLocalName(); 1498 1491 1499 List<String> entries = null; 1492 1500 List<List<String>> lists = null; … … 1520 1528 if (entries != null) { 1521 1529 collectionProperties.put(key, Collections.unmodifiableList(entries)); 1522 } 1523 if (lists != null) { 1530 } else if (lists != null) { 1524 1531 arrayProperties.put(key, Collections.unmodifiableList(lists)); 1525 } 1526 if (maps != null) { 1532 } else if (maps != null) { 1527 1533 listOfStructsProperties.put(key, Collections.unmodifiableList(maps)); 1534 } else { 1535 if (name.equals("lists")) { 1536 arrayProperties.put(key, Collections.<List<String>>emptyList()); 1537 } else if (name.equals("maps")) { 1538 listOfStructsProperties.put(key, Collections.<Map<String, String>>emptyList()); 1539 } else { 1540 collectionProperties.put(key, Collections.<String>emptyList()); 1541 } 1528 1542 } 1529 1543 } … … 1623 1637 1624 1638 public void visit(ListListSetting setting) { 1625 b.append(" <list key='").append(XmlWriter.encode(key)).append("'>\n");1639 b.append(" <lists key='").append(XmlWriter.encode(key)).append("'>\n"); 1626 1640 for (List<String> list : setting.getValue()) { 1627 1641 b.append(" <list>\n"); … … 1631 1645 b.append(" </list>\n"); 1632 1646 } 1633 b.append(" </list >\n");1647 b.append(" </lists>\n"); 1634 1648 } 1635 1649 1636 1650 public void visit(MapListSetting setting) { 1637 b.append(" < listkey='").append(XmlWriter.encode(key)).append("'>\n");1651 b.append(" <maps key='").append(XmlWriter.encode(key)).append("'>\n"); 1638 1652 for (Map<String, String> struct : setting.getValue()) { 1639 1653 b.append(" <map>\n"); … … 1643 1657 b.append(" </map>\n"); 1644 1658 } 1645 b.append(" </ list>\n");1659 b.append(" </maps>\n"); 1646 1660 } 1647 1661 }
Note:
See TracChangeset
for help on using the changeset viewer.