Changeset 11446 in josm


Ignore:
Timestamp:
2017-01-09T19:00:10+01:00 (8 years ago)
Author:
stoecker
Message:

add search option to find deleted objects (e.g. to purge them)

Location:
trunk/src/org/openstreetmap/josm/actions/search
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r11374 r11446  
    462462                .addKeyword("new", "new ", tr("all new objects"))
    463463                .addKeyword("selected", "selected ", tr("all selected objects"))
    464                 .addKeyword("incomplete", "incomplete ", tr("all incomplete objects")),
     464                .addKeyword("incomplete", "incomplete ", tr("all incomplete objects"))
     465                .addKeyword("deleted", "deleted ", tr("all deleted objects (checkbox <b>{0}</b> must be enabled)", tr("all objects"))),
    465466                GBC.eol());
    466467            right.add(new SearchKeywordRow(hcbSearchString)
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r11393 r11446  
    112112    public class CoreSimpleMatchFactory implements SimpleMatchFactory {
    113113        private final Collection<String> keywords = Arrays.asList("id", "version", "type", "user", "role",
    114                 "changeset", "nodes", "ways", "tags", "areasize", "waylength", "modified", "selected",
     114                "changeset", "nodes", "ways", "tags", "areasize", "waylength", "modified", "deleted", "selected",
    115115                "incomplete", "untagged", "closed", "new", "indownloadedarea",
    116116                "allindownloadedarea", "inview", "allinview", "timestamp", "nth", "nth%", "hasRole");
     
    121121            case "modified":
    122122                return new Modified();
     123            case "deleted":
     124                return new Deleted();
    123125            case "selected":
    124126                return new Selected();
     
    12561258
    12571259    /**
     1260     * Matches all objects that have been deleted
     1261     */
     1262    private static class Deleted extends Match {
     1263        @Override
     1264        public boolean match(OsmPrimitive osm) {
     1265            return osm.isDeleted();
     1266        }
     1267
     1268        @Override
     1269        public String toString() {
     1270            return "deleted";
     1271        }
     1272    }
     1273
     1274    /**
    12581275     * Matches all objects currently selected
    12591276     */
Note: See TracChangeset for help on using the changeset viewer.