Changeset 888 in josm


Ignore:
Timestamp:
Aug 29, 2008 12:02:27 AM (5 years ago)
Author:
stoecker
Message:

fixed search a bit. Closes #1397 and #485.

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

Legend:

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

    r755 r888  
    3838        JLabel label = new JLabel(tr("Please enter a search string.")); 
    3939        final JTextField input = new JTextField(lastSearch); 
    40         input.setToolTipText(tr("<html>Fulltext search.<ul>" + 
    41                         "<li><code>Baker Street</code>  - 'Baker' and 'Street' in any key or name.</li>" + 
    42                         "<li><code>\"Baker Street\"</code>  - 'Baker Street' in any key or name.</li>" + 
    43                         "<li><code>name:Bak</code>  - 'Bak' anywhere in the name.</li>" + 
    44                         "<li><code>-name:Bak</code>  - not 'Bak' in the name.</li>" + 
    45                         "<li><code>foot:</code>  - key=foot set to any value." + 
     40        input.setToolTipText(tr("<html>Fulltext search:<ul>" + 
     41                        "<li><b>Baker Street</b> - 'Baker' and 'Street' in any key or name.</li>" + 
     42                        "<li><b>\"Baker Street\"</b> - 'Baker Street' in any key or name.</li>" + 
     43                        "<li><b>name:Bak</b> - 'Bak' anywhere in the name.</li>" + 
     44                        "<li><b>-name:Bak</b> - not 'Bak' in the name.</li>" + 
     45                        "<li><b>foot:</b> - key=foot set to any value.</li>" + 
     46                        "<li>Special targets:</li>" + 
     47                        "<li><b>type:</b> - type of the object (<b>node</b>, <b>way</b>, <b>relation</b>)</li>" + 
     48                        "<li><b>user:</b>... - all objects changed by user</li>" + 
     49                        "<li><b>id:</b>... - object with given ID</li>" + 
     50                        "<li><b>nodes:</b>... - object with given number of nodes</li>" + 
     51                        "<li><b>modified</b> - all changed objects</li>" + 
     52                        "<li><b>incomplete</b> - all incomplete objects</li>" + 
     53                        "<li>Use <b>|</b> or <b>OR</b> to combine with logical or</li>" + 
     54                        "<li>Use <b>\"</b> to quote operators (e.g. if key contains :)</li>" + 
    4655        "</ul></html>")); 
    4756     
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r627 r888  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others 
    22package org.openstreetmap.josm.actions.search; 
     3 
     4import static org.openstreetmap.josm.tools.I18n.tr; 
    35 
    46import java.io.PushbackReader; 
     
    153155        private static class Modified extends Match { 
    154156                @Override public boolean match(OsmPrimitive osm) { 
    155                         return osm.modified; 
     157                        return osm.modified || osm.id == 0; 
    156158                } 
    157159                @Override public String toString() {return "modified";} 
     
    210212                        Match b = parseNot(); 
    211213                        if (a == null || b == null) { 
    212                                 throw new ParseError("Missing arguments for or."); 
     214                                throw new ParseError(tr("Missing arguments for or.")); 
    213215                        } 
    214216                        return new Or(a, b); 
     
    221223                        Match m = parseParens(); 
    222224                        if (m == null) { 
    223                                 throw new ParseError("Missing argument for not."); 
     225                                throw new ParseError(tr("Missing argument for not.")); 
    224226                        } 
    225227                        return new Not(m); 
     
    232234                        Match m = parseJuxta(); 
    233235                        if (!tokenizer.readIfEqual(")")) { 
    234                                 throw new ParseError("Expected closing paren"); 
     236                                throw new ParseError(tr("Expected closing parenthesis.")); 
    235237                        } 
    236238                        return m; 
Note: See TracChangeset for help on using the changeset viewer.