- Timestamp:
- 2016-02-09T00:07:34+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r9623 r9762 1370 1370 if (sel.isEmpty()) 1371 1371 return; 1372 String sep = ""; 1373 StringBuilder s = new StringBuilder(); 1374 for (OsmPrimitive p : sel) { 1375 String val = p.get(key); 1376 if (val == null) { 1377 continue; 1378 } 1379 String t = ""; 1380 if (!sameType) { 1381 t = ""; 1382 } else if (p instanceof Node) { 1383 t = "type:node "; 1384 } else if (p instanceof Way) { 1385 t = "type:way "; 1386 } else if (p instanceof Relation) { 1387 t = "type:relation "; 1388 } 1372 final SearchSetting ss = createSearchSetting(key, sel, sameType); 1373 org.openstreetmap.josm.actions.search.SearchAction.searchWithoutHistory(ss); 1374 } 1375 } 1376 1377 static SearchSetting createSearchSetting(String key, Collection<OsmPrimitive> sel, boolean sameType) { 1378 String sep = ""; 1379 StringBuilder s = new StringBuilder(); 1380 Set<String> consideredTokens = new TreeSet<>(); 1381 for (OsmPrimitive p : sel) { 1382 String val = p.get(key); 1383 if (val == null || (!sameType && consideredTokens.contains(val))) { 1384 continue; 1385 } 1386 String t = ""; 1387 if (!sameType) { 1388 t = ""; 1389 } else if (p instanceof Node) { 1390 t = "type:node "; 1391 } else if (p instanceof Way) { 1392 t = "type:way "; 1393 } else if (p instanceof Relation) { 1394 t = "type:relation "; 1395 } 1396 String token = new StringBuilder(t).append(val).toString(); 1397 if (consideredTokens.add(token)) { 1389 1398 s.append(sep).append('(').append(t).append('"').append( 1390 1399 org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(key)).append("\"=\"").append( … … 1392 1401 sep = " OR "; 1393 1402 } 1394 1395 final SearchSetting ss = new SearchSetting(); 1396 ss.text = s.toString();1397 ss.caseSensitive = true;1398 org.openstreetmap.josm.actions.search.SearchAction.searchWithoutHistory(ss);1399 }1403 } 1404 1405 final SearchSetting ss = new SearchSetting(); 1406 ss.text = s.toString(); 1407 ss.caseSensitive = true; 1408 return ss; 1400 1409 } 1401 1410
Note:
See TracChangeset
for help on using the changeset viewer.