Changeset 1670 in josm for trunk/src/org/openstreetmap/josm/actions/search
- Timestamp:
- 2009-06-15T20:22:46+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SelectionWebsiteLoader.java
r1195 r1670 22 22 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 23 23 import org.openstreetmap.josm.io.OsmIdReader; 24 import org.openstreetmap.josm.io.OsmTransferException; 24 25 import org.openstreetmap.josm.io.ProgressInputStream; 25 26 import org.xml.sax.SAXException; … … 47 48 for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) { 48 49 if (ids.containsKey(osm.id) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.id))) { 49 if (mode == SearchAction.SearchMode.remove) 50 if (mode == SearchAction.SearchMode.remove) { 50 51 sel.remove(osm); 51 else52 } else { 52 53 sel.add(osm); 54 } 53 55 } 54 56 } … … 59 61 e.printStackTrace(); 60 62 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in URL: \"{0}\"",url)); 63 } catch(OsmTransferException e) { 64 e.printStackTrace(); 65 if (e.getCause() != null) { 66 if (e.getCause() instanceof IOException ) { 67 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from URL: \"{0}\"",url), 68 tr("Error"), JOptionPane.ERROR_MESSAGE); 69 } else if (e.getCause() instanceof SAXException) { 70 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in URL: \"{0}\"",url), 71 tr("Error"), JOptionPane.ERROR_MESSAGE); 72 } 73 } else { 74 JOptionPane.showMessageDialog(Main.parent,tr("Error while communicating with server.",url), 75 tr("Error"), JOptionPane.ERROR_MESSAGE); 76 } 77 61 78 } 62 79 } … … 66 83 } 67 84 @Override protected void finish() { 68 if (sel != null) 85 if (sel != null) { 69 86 Main.ds.setSelected(sel); 87 } 70 88 } 71 89 }
Note:
See TracChangeset
for help on using the changeset viewer.