Changeset 2695 in josm for trunk/src


Ignore:
Timestamp:
2009-12-28T13:01:26+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #4241: Add the ability to use JOSM Search to find an object version

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

Legend:

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

    r2676 r2695  
    126126                    + "<li>"+tr("<b>user:anonymous</b> - all objects changed by anonymous users")+"</li>"
    127127                    + "<li>"+tr("<b>id:</b>... - object with given ID (0 for new objects)")+"</li>"
     128                    + "<li>"+tr("<b>version:</b>... - object with given version (0 objects without an assigned version)")+"</li>"
    128129                    + "<li>"+tr("<b>changeset:</b>... - object with given changeset id (0 objects without assigned changeset)")+"</li>"
    129130                    + "<li>"+tr("<b>nodes:</b>... - object with given number of nodes (nodes:count or nodes:min-max)")+"</li>"
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r2661 r2695  
    111111        }
    112112        @Override public String toString() {return "changeset="+changesetid;}
     113    }
     114
     115    private static class Version extends Match {
     116        private long version;
     117        public Version(long version) {this.version = version;}
     118        @Override public boolean match(OsmPrimitive osm) {
     119            return osm.getVersion() == version;
     120        }
     121        @Override public String toString() {return "version="+version;}
    113122    }
    114123
     
    708717                throw new ParseError(tr("Incorrect value of changeset operator: {0}. Number is expected.", value));
    709718            }
    710         } else
     719
     720        }   else if (key.equals("version")) {
     721            try {
     722                return new Version(Long.parseLong(value));
     723            } catch (NumberFormatException x) {
     724                throw new ParseError(tr("Incorrect value of version operator: {0}. Number is expected.", value));
     725            }
     726        }
     727        else
    711728            return new KeyValue(key, value, regexSearch, caseSensitive);
    712729    }
Note: See TracChangeset for help on using the changeset viewer.