Changeset 9116 in osm for applications/editors
- Timestamp:
- 2008-07-17T13:42:51+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/namefinder/namefinder/PlaceSelection.java
r8909 r9116 163 163 try 164 164 { 165 component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 166 component.repaint(); 167 URL url = new URL("http://gazetteer.openstreetmap.org/namefinder/search.xml?find=" 168 +java.net.URLEncoder.encode(searchTerm.getText(), "UTF-8")); 169 HttpURLConnection activeConnection = (HttpURLConnection)url.openConnection(); 170 //System.out.println("got return: "+activeConnection.getResponseCode()); 171 activeConnection.setConnectTimeout(15000); 172 InputStream inputStream = activeConnection.getInputStream(); 173 InputSource inputSource = new InputSource(new InputStreamReader(inputStream, "UTF-8")); 174 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new Parser()); 165 String searchtext = searchTerm.getText(); 166 if(searchtext.isEmpty()) 167 { 168 JOptionPane.showMessageDialog(Main.parent,tr("Please enter a search string")); 169 } 170 else 171 { 172 component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 173 component.repaint(); 174 URL url = new URL("http://gazetteer.openstreetmap.org/namefinder/search.xml?find=" 175 +java.net.URLEncoder.encode(searchTerm.getText(), "UTF-8")); 176 HttpURLConnection activeConnection = (HttpURLConnection)url.openConnection(); 177 //System.out.println("got return: "+activeConnection.getResponseCode()); 178 activeConnection.setConnectTimeout(15000); 179 InputStream inputStream = activeConnection.getInputStream(); 180 InputSource inputSource = new InputSource(new InputStreamReader(inputStream, "UTF-8")); 181 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new Parser()); 182 } 175 183 } 176 184 catch (Exception x)
Note:
See TracChangeset
for help on using the changeset viewer.