Changeset 26964 in osm for applications/editors
- Timestamp:
- 2011-10-24T23:18:39+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/tag2link
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkConstants.java
r26921 r26964 39 39 public static String ICON_24 = "tag2linkv2_24x24.png"; 40 40 public static String ICON_48 = "tag2linkv2_48x48.png"; 41 42 public static String MAIL_ICON_24 = "tag2mailv3_24x24.png"; 41 43 } -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkPlugin.java
r26963 r26964 29 29 * @author Don-vip 30 30 * History: 31 * 0.2d 24-Oct-2011 Icon for Mail action 31 32 * 0.2c 24-Oct-2011 Another MHS rule 32 33 * 0.2b 24-Oct-2011 UNESCO WHC rule working -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/action/OpenLinkAction.java
r26936 r26964 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Desktop;6 5 import java.awt.event.ActionEvent; 7 import java.net.URI;8 6 9 7 import org.openstreetmap.josm.actions.JosmAction; … … 24 22 @Override 25 23 public void actionPerformed(ActionEvent e) { 26 if (url.matches("mailto:.*")) {27 if (Desktop.isDesktopSupported()) {28 try {29 System.out.println("Sending "+url);30 Desktop.getDesktop().mail(new URI(url));31 } catch (Exception ex) {32 ex.printStackTrace();33 }34 }35 }36 24 System.out.println("Opening "+url); 37 25 OpenBrowser.displayUrl(url); -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/listeners/AbstractPopupListener.java
r26917 r26964 24 24 import javax.swing.event.PopupMenuListener; 25 25 26 import org.openstreetmap.josm.actions.JosmAction; 26 27 import org.openstreetmap.josm.gui.MapFrame; 27 28 import org.openstreetmap.josm.plugins.tag2link.action.OpenLinkAction; 29 import org.openstreetmap.josm.plugins.tag2link.action.OpenMailAction; 28 30 import org.openstreetmap.josm.plugins.tag2link.data.Link; 29 31 … … 52 54 53 55 protected void addLink(JPopupMenu popup, Link link) { 54 itemList.add(popup.add(new OpenLinkAction(link))); 56 JosmAction action = null; 57 if (link.url.matches("mailto:.*")) { 58 action = new OpenMailAction(link); 59 } else { 60 action = new OpenLinkAction(link); 61 } 62 63 itemList.add(popup.add(action)); 55 64 } 56 65 }
Note:
See TracChangeset
for help on using the changeset viewer.