Changeset 12662 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2017-08-26T01:29:38+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/search
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r12659 r12662 47 47 import org.openstreetmap.josm.data.osm.Filter; 48 48 import org.openstreetmap.josm.data.osm.OsmPrimitive; 49 import org.openstreetmap.josm.data.osm.search.PushbackTokenizer; 50 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 51 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match; 52 import org.openstreetmap.josm.data.osm.search.SearchCompiler.SimpleMatchFactory; 53 import org.openstreetmap.josm.data.osm.search.SearchMode; 49 54 import org.openstreetmap.josm.data.osm.search.SearchParseError; 50 55 import org.openstreetmap.josm.data.osm.search.SearchSetting; 51 import org.openstreetmap.josm.data.osm.search.SearchCompiler;52 import org.openstreetmap.josm.data.osm.search.SearchMode;53 56 import org.openstreetmap.josm.gui.ExtendedDialog; 54 57 import org.openstreetmap.josm.gui.MainApplication; … … 89 92 private static final LinkedList<SearchSetting> searchHistory = new LinkedList<>(); 90 93 static { 94 SearchCompiler.addMatchFactory(new SimpleMatchFactory() { 95 @Override 96 public Collection<String> getKeywords() { 97 return Arrays.asList("inview", "allinview"); 98 } 99 100 @Override 101 public Match get(String keyword, PushbackTokenizer tokenizer) throws SearchParseError { 102 switch(keyword) { 103 case "inview": 104 return new InView(false); 105 case "allinview": 106 return new InView(true); 107 default: 108 throw new IllegalStateException("Not expecting keyword " + keyword); 109 } 110 } 111 }); 112 91 113 for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) { 92 114 SearchSetting ss = SearchSetting.readFromString(s);
Note:
See TracChangeset
for help on using the changeset viewer.