Changeset 30372 in osm for applications/editors/josm
- Timestamp:
- 2014-03-26T20:59:59+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/pointInfo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pointInfo/README.md
r30368 r30372 14 14 ##Websites 15 15 16 * OSM wiki - not availa vle yet16 * OSM wiki - not available yet 17 17 * [JOSM svn](https://trac.openstreetmap.org/browser/subversion/applications/editors/josm/plugins/pointInfo) 18 18 * [Github](https://github.com/mkyral/josm-pointInfo) -
applications/editors/josm/plugins/pointInfo/build.xml
r30367 r30372 15 15 16 16 <!-- enter the SVN commit message --> 17 <property name="commit.message" value="PointInfo: Replace o rg.json with JOSM embedded (GPL-compliant) jsonp."/>17 <property name="commit.message" value="PointInfo: Replace openWebPage function by josm.tools.OpenBrowser."/> 18 18 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 19 19 <property name="plugin.main.version" value="6238"/> -
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/PointInfoAction.java
r30334 r30372 22 22 import java.awt.Cursor; 23 23 import java.awt.Point; 24 import java.awt.Desktop;25 24 import java.awt.event.ActionEvent; 26 25 import java.awt.event.InputEvent; … … 39 38 import javax.swing.event.HyperlinkEvent; 40 39 import javax.swing.event.HyperlinkListener; 41 import java.net.URI;42 import java.net.URISyntaxException;43 40 44 41 import org.openstreetmap.josm.Main; … … 55 52 import org.openstreetmap.josm.tools.ImageProvider; 56 53 import org.openstreetmap.josm.tools.Shortcut; 54 import org.openstreetmap.josm.tools.OpenBrowser; 57 55 import org.xml.sax.SAXException; 58 56 … … 91 89 private static Cursor getCursor() { 92 90 return ImageProvider.getCursor("crosshair", "info-sml"); 93 }94 95 private static void openWebpage(URI uri) {96 Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;97 if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {98 try {99 desktop.browse(uri);100 } catch (Exception e) {101 e.printStackTrace();102 }103 }104 91 } 105 92 … … 137 124 mRuian.performAction(hle.getURL().toString()); 138 125 } else { 139 try { 140 openWebpage(hle.getURL().toURI()); 141 } catch (URISyntaxException e) { 142 e.printStackTrace(); 126 String ret = OpenBrowser.displayUrl(hle.getURL().toString()); 127 if (ret != null) { 128 PointInfoUtils.showNotification(ret, "error"); 143 129 } 144 130 }
Note:
See TracChangeset
for help on using the changeset viewer.