Changeset 26964 in osm for applications/editors


Ignore:
Timestamp:
2011-10-24T23:18:39+02:00 (13 years ago)
Author:
donvip
Message:

tag2link 0.2d: Mail icon

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  
    3939        public static String ICON_24 = "tag2linkv2_24x24.png";
    4040    public static String ICON_48 = "tag2linkv2_48x48.png";
     41   
     42    public static String MAIL_ICON_24 = "tag2mailv3_24x24.png";
    4143}
  • applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkPlugin.java

    r26963 r26964  
    2929 * @author Don-vip
    3030 * History:
     31 * 0.2d 24-Oct-2011 Icon for Mail action
    3132 * 0.2c 24-Oct-2011 Another MHS rule
    3233 * 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  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
    5 import java.awt.Desktop;
    65import java.awt.event.ActionEvent;
    7 import java.net.URI;
    86
    97import org.openstreetmap.josm.actions.JosmAction;
     
    2422    @Override
    2523    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         }
    3624        System.out.println("Opening "+url);
    3725        OpenBrowser.displayUrl(url);
  • applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/listeners/AbstractPopupListener.java

    r26917 r26964  
    2424import javax.swing.event.PopupMenuListener;
    2525
     26import org.openstreetmap.josm.actions.JosmAction;
    2627import org.openstreetmap.josm.gui.MapFrame;
    2728import org.openstreetmap.josm.plugins.tag2link.action.OpenLinkAction;
     29import org.openstreetmap.josm.plugins.tag2link.action.OpenMailAction;
    2830import org.openstreetmap.josm.plugins.tag2link.data.Link;
    2931
     
    5254   
    5355    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));
    5564    }
    5665}
Note: See TracChangeset for help on using the changeset viewer.