- Timestamp:
- 2014-02-17T01:07:57+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r6733 r6856 277 277 */ 278 278 public static void readFromPreferences() { 279 taggingPresets = TaggingPresetReader.readFromPreferences(false); 279 taggingPresets = TaggingPresetReader.readFromPreferences(false, false); 280 280 } 281 281 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r6670 r6856 237 237 } 238 238 239 /** 240 * Reads all tagging presets from the given sources. 241 * @param sources Collection of tagging presets sources. 242 * @param validate if {@code true}, presets will be validated against XML schema 243 * @return Collection of all presets successfully read 244 */ 239 245 public static Collection<TaggingPreset> readAll(Collection<String> sources, boolean validate) { 246 return readAll(sources, validate, true); 247 } 248 249 /** 250 * Reads all tagging presets from the given sources. 251 * @param sources Collection of tagging presets sources. 252 * @param validate if {@code true}, presets will be validated against XML schema 253 * @param displayErrMsg if {@code true}, a blocking error message is displayed in case of I/O exception. 254 * @return Collection of all presets successfully read 255 */ 256 public static Collection<TaggingPreset> readAll(Collection<String> sources, boolean validate, boolean displayErrMsg) { 240 257 LinkedList<TaggingPreset> allPresets = new LinkedList<TaggingPreset>(); 241 258 for(String source : sources) { … … 243 260 allPresets.addAll(readAll(source, validate)); 244 261 } catch (IOException e) { 245 Main.error(e); 262 Main.error(e, false); 246 263 Main.error(source); 247 JOptionPane.showMessageDialog( 248 Main.parent, 249 tr("Could not read tagging preset source: {0}",source), 250 tr("Error"), 251 JOptionPane.ERROR_MESSAGE 252 ); 264 if (source.startsWith("http")) { 265 Main.addNetworkError(source, e); 266 } 267 if (displayErrMsg) { 268 JOptionPane.showMessageDialog( 269 Main.parent, 270 tr("Could not read tagging preset source: {0}",source), 271 tr("Error"), 272 JOptionPane.ERROR_MESSAGE 273 ); 274 } 253 275 } catch (SAXException e) { 254 276 Main.error(e); … … 265 287 } 266 288 267 public static Collection<TaggingPreset> readFromPreferences(boolean validate) { 268 return readAll(getPresetSources(), validate); 289 /** 290 * Reads all tagging presets from sources stored in preferences. 291 * @param validate if {@code true}, presets will be validated against XML schema 292 * @param displayErrMsg if {@code true}, a blocking error message is displayed in case of I/O exception. 293 * @return Collection of all presets successfully read 294 */ 295 public static Collection<TaggingPreset> readFromPreferences(boolean validate, boolean displayErrMsg) { 296 return readAll(getPresetSources(), validate, displayErrMsg); 269 297 } 270 298
Note:
See TracChangeset
for help on using the changeset viewer.