- Timestamp:
- 2015-09-22T22:00:06+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8710 r8786 853 853 854 854 @Override 855 Boolean matches(Map<String, String> tags) { 856 for (Check check : checks) { 857 if (Boolean.TRUE.equals(check.matches(tags))) { 858 return true; 859 } 860 } 861 return null; 862 } 863 864 @Override 855 865 public String toString() { 856 866 return "CheckGroup [columns=" + columns + "]"; -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
r8510 r8786 210 210 for (final TaggingPreset p : presets) { 211 211 for (TaggingPresetItem item : p.data) { 212 if (item instanceof TaggingPresetItems.KeyedItem) { 213 TaggingPresetItems.KeyedItem ki = (TaggingPresetItems.KeyedItem) item; 214 if (ki.key != null && ki.getValues() != null) { 215 try { 216 PRESET_TAG_CACHE.putAll(ki.key, ki.getValues()); 217 } catch (NullPointerException e) { 218 Main.error(p+": Unable to cache "+ki); 219 } 220 } 221 } else if (item instanceof TaggingPresetItems.Roles) { 222 TaggingPresetItems.Roles r = (TaggingPresetItems.Roles) item; 223 for (TaggingPresetItems.Role i : r.roles) { 224 if (i.key != null) { 225 PRESET_ROLE_CACHE.add(i.key); 226 } 227 } 212 cachePresetItem(p, item); 213 } 214 } 215 } 216 217 protected static void cachePresetItem(TaggingPreset p, TaggingPresetItem item) { 218 if (item instanceof TaggingPresetItems.KeyedItem) { 219 TaggingPresetItems.KeyedItem ki = (TaggingPresetItems.KeyedItem) item; 220 if (ki.key != null && ki.getValues() != null) { 221 try { 222 PRESET_TAG_CACHE.putAll(ki.key, ki.getValues()); 223 } catch (NullPointerException e) { 224 Main.error(p + ": Unable to cache " + ki); 228 225 } 226 } 227 } else if (item instanceof TaggingPresetItems.Roles) { 228 TaggingPresetItems.Roles r = (TaggingPresetItems.Roles) item; 229 for (TaggingPresetItems.Role i : r.roles) { 230 if (i.key != null) { 231 PRESET_ROLE_CACHE.add(i.key); 232 } 233 } 234 } else if (item instanceof TaggingPresetItems.CheckGroup) { 235 for (TaggingPresetItems.KeyedItem check : ((TaggingPresetItems.CheckGroup) item).checks) { 236 cachePresetItem(p, check); 229 237 } 230 238 }
Note:
See TracChangeset
for help on using the changeset viewer.