Ticket #19327: 19327.patch

File 19327.patch, 171.3 KB (added by simon04, 4 years ago)
  • src/org/openstreetmap/josm/actions/AboutAction.java

    commit a51a99e7d853a3449b4e127d9a33e4d6f0a786e4
    Author: Simon Legner <Simon.Legner@gmail.com>
    Date:   2020-05-31 13:13:28 +0200
    
        fix #19327 - Deprecate JosmAction constructors, use setters
    
    diff --git a/src/org/openstreetmap/josm/actions/AboutAction.java b/src/org/openstreetmap/josm/actions/AboutAction.java
    index 505db8eb7..464db094f 100644
    a b  
    6161     * Constructs a new {@code AboutAction}.
    6262     */
    6363    public AboutAction() {
    64         super(tr("About"), "logo", tr("Display the about screen."),
    65             Shortcut.registerShortcut("system:about", tr("About"),
    66             KeyEvent.VK_F1, Shortcut.SHIFT), true, false);
     64        super(false);
     65        setName(tr("About"));
     66        setIcon("logo");
     67        setShortcut(Shortcut.registerShortcut("system:about", tr("About"), KeyEvent.VK_F1, Shortcut.SHIFT));
     68        setTooltip(tr("Display the about screen."));
     69        registerInToolbar("logo");
    6770    }
    6871
    6972    JPanel buildAboutPanel() {
  • src/org/openstreetmap/josm/actions/AbstractInfoAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AbstractInfoAction.java b/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
    index f07f39595..a0a8fa625 100644
    a b  
    1717import org.openstreetmap.josm.gui.MainApplication;
    1818import org.openstreetmap.josm.tools.Logging;
    1919import org.openstreetmap.josm.tools.OpenBrowser;
    20 import org.openstreetmap.josm.tools.Shortcut;
    2120
    2221/**
    2322 * Abstract base class for info actions, opening an URL describing a particular object.
    public AbstractInfoAction(boolean installAdapters) {  
    3332        super(installAdapters);
    3433    }
    3534
    36     /**
    37      * Constructs a new {@code AbstractInfoAction}.
    38      * @param name the action's text as displayed on the menu (if it is added to a menu)
    39      * @param iconName the filename of the icon to use
    40      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    41      *           that html is not supported for menu actions on some platforms.
    42      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    43      *            do want a shortcut, remember you can always register it with group=none, so you
    44      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    45      *            the user CANNOT configure a shortcut for your action.
    46      * @param register register this action for the toolbar preferences?
    47      * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    48      * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    49      */
    50     public AbstractInfoAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register,
    51             String toolbarId, boolean installAdapters) {
    52         super(name, iconName, tooltip, shortcut, register, toolbarId, installAdapters);
    53     }
    54 
    5535    /**
    5636     * Asks user confirmation before launching a large number of browser windows.
    5737     * @param numBrowsers the number of browser windows to open
  • src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AbstractMergeAction.java b/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
    index 3da551439..90a722208 100644
    a b  
    1919import org.openstreetmap.josm.gui.layer.Layer;
    2020import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2121import org.openstreetmap.josm.tools.GBC;
    22 import org.openstreetmap.josm.tools.Shortcut;
    2322import org.openstreetmap.josm.tools.Utils;
    2423
    2524/**
    public TargetLayerDialogResult(T sel, boolean ch) {  
    8483        }
    8584    }
    8685
    87     /**
    88      * Constructs a new {@code AbstractMergeAction}.
    89      * @param name the action's text as displayed on the menu (if it is added to a menu)
    90      * @param iconName the filename of the icon to use
    91      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    92      *           that html is not supported for menu actions on some platforms.
    93      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    94      *            do want a shortcut, remember you can always register it with group=none, so you
    95      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    96      *            the user CANNOT configure a shortcut for your action.
    97      * @param register register this action for the toolbar preferences?
    98      */
    99     public AbstractMergeAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) {
    100         super(name, iconName, tooltip, shortcut, register);
    101     }
    102 
    103     /**
    104      * Constructs a new {@code AbstractMergeAction}.
    105      * @param name the action's text as displayed on the menu (if it is added to a menu)
    106      * @param iconName the filename of the icon to use
    107      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    108      *           that html is not supported for menu actions on some platforms.
    109      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    110      *            do want a shortcut, remember you can always register it with group=none, so you
    111      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    112      *            the user CANNOT configure a shortcut for your action.
    113      * @param register register this action for the toolbar preferences?
    114      * @param toolbar identifier for the toolbar preferences. The iconName is used, if this parameter is null
    115      * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    116      */
    117     public AbstractMergeAction(String name, String iconName, String tooltip, Shortcut shortcut,
    118     boolean register, String toolbar, boolean installAdapters) {
    119         super(name, iconName, tooltip, shortcut, register, toolbar, installAdapters);
    120     }
    121 
    12286    /**
    12387     * Ask user to choose the target layer and shows a checkbox.
    12488     * @param targetLayers list of candidate target layers.
  • src/org/openstreetmap/josm/actions/AbstractPasteAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AbstractPasteAction.java b/src/org/openstreetmap/josm/actions/AbstractPasteAction.java
    index 00ee85c63..7bfac246a 100644
    a b  
    1515import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    1616import org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler;
    1717import org.openstreetmap.josm.tools.Logging;
    18 import org.openstreetmap.josm.tools.Shortcut;
    1918
    2019/**
    2120 * This is the base class for all actions that paste objects.
     
    2827
    2928    /**
    3029     * Constructs a new {@link AbstractPasteAction}.
    31      * @param name the action's text as displayed on the menu (if it is added to a menu)
    32      * @param iconName the filename of the icon to use
    33      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    34      *           that html is not supported for menu actions on some platforms.
    35      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    36      *            do want a shortcut, remember you can always register it with group=none, so you
    37      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    38      *            the user CANNOT configure a shortcut for your action.
    39      * @param registerInToolbar register this action for the toolbar preferences?
    4030     */
    41     public AbstractPasteAction(String name, String iconName, String tooltip, Shortcut shortcut,
    42             boolean registerInToolbar) {
    43         this(name, iconName, tooltip, shortcut, registerInToolbar, null);
    44     }
    45 
    46     /**
    47      * Constructs a new {@link AbstractPasteAction}.
    48      * @param name the action's text as displayed on the menu (if it is added to a menu)
    49      * @param iconName the filename of the icon to use
    50      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    51      *           that html is not supported for menu actions on some platforms.
    52      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    53      *            do want a shortcut, remember you can always register it with group=none, so you
    54      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    55      *            the user CANNOT configure a shortcut for your action.
    56      * @param registerInToolbar register this action for the toolbar preferences?
    57      * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    58      */
    59     public AbstractPasteAction(String name, String iconName, String tooltip, Shortcut shortcut,
    60             boolean registerInToolbar, String toolbarId) {
    61         super(name, iconName, tooltip, shortcut, registerInToolbar, toolbarId, true);
     31    public AbstractPasteAction() {
    6232        transferHandler = new OsmTransferHandler();
    6333        ClipboardUtils.getClipboard().addFlavorListener(this);
    6434    }
  • src/org/openstreetmap/josm/actions/AbstractUploadAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AbstractUploadAction.java b/src/org/openstreetmap/josm/actions/AbstractUploadAction.java
    index 234c0ac41..a4066c19a 100644
    a b  
    66import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
    77import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    88import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    9 import org.openstreetmap.josm.tools.Shortcut;
    109
    1110/**
    1211 * Abstract super-class of all upload actions.
     
    1514 */
    1615public abstract class AbstractUploadAction extends JosmAction {
    1716
    18     /**
    19      * Constructs a new {@code AbstractUploadAction}.
    20      *
    21      * @param name the action's text as displayed on the menu (if it is added to a menu)
    22      * @param iconName the filename of the icon to use
    23      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    24      *           that html is not supported for menu actions on some platforms.
    25      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    26      *            do want a shortcut, remember you can always register it with group=none, so you
    27      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    28      *            the user CANNOT configure a shortcut for your action.
    29      * @param registerInToolbar register this action for the toolbar preferences?
    30      */
    31     public AbstractUploadAction(String name, String iconName, String tooltip, Shortcut shortcut,
    32             boolean registerInToolbar) {
    33         super(name, iconName, tooltip, shortcut, registerInToolbar);
    34     }
    35 
    3617    private final PropertyChangeListener updateOnRequireUploadChange = evt -> {
    3718        if (OsmDataLayer.REQUIRES_UPLOAD_TO_SERVER_PROP.equals(evt.getPropertyName())) {
    3819            updateEnabledState();
  • src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java b/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
    index e0e8dee82..f3c7344e5 100644
    a b  
    7171     * @param info The imagery info
    7272     */
    7373    public AddImageryLayerAction(ImageryInfo info) {
    74         super(info.getMenuName(), /* ICON */"imagery_menu", info.getToolTipText(), null,
    75                 true, ToolbarPreferences.IMAGERY_PREFIX + info.getToolbarName(), false);
     74        super(false);
     75        setName(info.getMenuName());
     76        setIcon(/* ICON */ "imagery_menu");
     77        setTooltip(info.getToolTipText());
     78        registerInToolbar(ToolbarPreferences.IMAGERY_PREFIX + info.getToolbarName());
    7679        setHelpId(ht("/Preferences/Imagery"));
    7780        this.info = info;
    78         installAdapters();
    7981
    8082        // change toolbar icon from if specified
    8183        String icon = info.getIcon();
  • src/org/openstreetmap/josm/actions/AddNodeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AddNodeAction.java b/src/org/openstreetmap/josm/actions/AddNodeAction.java
    index 542164d70..e036ea0f3 100644
    a b  
    3333     * Constructs a new {@code AddNodeAction}.
    3434     */
    3535    public AddNodeAction() {
    36         super(tr("Add Node..."), "addnode", tr("Add a node by entering latitude / longitude or easting / northing."),
    37                 Shortcut.registerShortcut("addnode", tr("Edit: {0}", tr("Add Node...")),
    38                         KeyEvent.VK_D, Shortcut.SHIFT), true);
     36        setName(tr("Add Node..."));
     37        setIcon("addnode");
     38        setShortcut(Shortcut.registerShortcut("addnode", tr("Edit: {0}", tr("Add Node...")), KeyEvent.VK_D, Shortcut.SHIFT));
     39        setTooltip(tr("Add a node by entering latitude / longitude or easting / northing."));
     40        registerInToolbar("addnode");
    3941        setHelpId(ht("/Action/AddNode"));
    4042    }
    4143
  • src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AlignInCircleAction.java b/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
    index 85f25eee9..1ca87e521 100644
    a b  
    4747     * Constructs a new {@code AlignInCircleAction}.
    4848     */
    4949    public AlignInCircleAction() {
    50         super(tr("Align Nodes in Circle"), "aligncircle", tr("Move the selected nodes into a circle."),
    51                 Shortcut.registerShortcut("tools:aligncircle", tr("Tool: {0}", tr("Align Nodes in Circle")),
    52                         KeyEvent.VK_O, Shortcut.DIRECT), true);
     50        setName(tr("Align Nodes in Circle"));
     51        setIcon("aligncircle");
     52        setShortcut(Shortcut.registerShortcut("tools:aligncircle", tr("Tool: {0}", tr("Align Nodes in Circle")),
     53                KeyEvent.VK_O, Shortcut.DIRECT));
     54        setTooltip(tr("Move the selected nodes into a circle."));
     55        registerInToolbar("aligncircle");
    5356        setHelpId(ht("/Action/AlignInCircle"));
    5457    }
    5558
  • src/org/openstreetmap/josm/actions/AlignInLineAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AlignInLineAction.java b/src/org/openstreetmap/josm/actions/AlignInLineAction.java
    index 9bf800da8..60debb6e7 100644
    a b  
    5454     * Constructs a new {@code AlignInLineAction}.
    5555     */
    5656    public AlignInLineAction() {
    57         super(tr("Align Nodes in Line"), "alignline", tr("Move the selected nodes in to a line."),
    58                 Shortcut.registerShortcut("tools:alignline", tr("Tool: {0}", tr("Align Nodes in Line")), KeyEvent.VK_L, Shortcut.DIRECT), true);
     57        setName(tr("Align Nodes in Line"));
     58        setIcon("alignline");
     59        setShortcut(Shortcut.registerShortcut("tools:alignline", tr("Tool: {0}", tr("Align Nodes in Line")), KeyEvent.VK_L, Shortcut.DIRECT));
     60        setTooltip(tr("Move the selected nodes in to a line."));
     61        registerInToolbar("alignline");
    5962        setHelpId(ht("/Action/AlignInLine"));
    6063    }
    6164
  • src/org/openstreetmap/josm/actions/AutoScaleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/AutoScaleAction.java b/src/org/openstreetmap/josm/actions/AutoScaleAction.java
    index 989554605..92b72da5d 100644
    a b private AutoScaleAction(AutoScaleMode mode, boolean marker) {  
    198198     * @since 14221
    199199     */
    200200    public AutoScaleAction(final AutoScaleMode mode) {
    201         super(tr("Zoom to {0}", mode.getLocalizedLabel()), "dialogs/autoscale/" + mode.getEnglishLabel(),
    202               tr("Zoom the view to {0}.", mode.getLocalizedLabel()),
    203               Shortcut.registerShortcut("view:zoom" + mode.getEnglishLabel(),
    204                         tr("View: {0}", tr("Zoom to {0}", mode.getLocalizedLabel())),
    205                         getModeShortcut(mode.getEnglishLabel()), Shortcut.DIRECT), true, null, false);
     201        super(false);
     202        setName(tr("Zoom to {0}", mode.getLocalizedLabel()));
     203        setTooltip(tr("Zoom the view to {0}.", mode.getLocalizedLabel()));
     204        String iconName = "dialogs/autoscale/" + mode.getEnglishLabel();
     205        setIcon(iconName);
     206        registerInToolbar(iconName);
     207        setShortcut(Shortcut.registerShortcut("view:zoom" + mode.getEnglishLabel(),
     208                tr("View: {0}", tr("Zoom to {0}", mode.getLocalizedLabel())),
     209                getModeShortcut(mode.getEnglishLabel()), Shortcut.DIRECT));
    206210        String label = mode.getEnglishLabel();
    207211        String modeHelp = Character.toUpperCase(label.charAt(0)) + label.substring(1);
    208212        setHelpId("Action/AutoScale/" + modeHelp);
  • src/org/openstreetmap/josm/actions/ChangesetManagerToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ChangesetManagerToggleAction.java b/src/org/openstreetmap/josm/actions/ChangesetManagerToggleAction.java
    index 46e62eb90..4272f2c4b 100644
    a b  
    2525     * Constructs a new {@code ChangesetManagerToggleAction}.
    2626     */
    2727    public ChangesetManagerToggleAction() {
    28         super(tr("Changeset Manager"),
    29                 new ImageProvider("dialogs/changeset/changesetmanager").setOptional(true),
    30                 tr("Toggle visibility of Changeset Manager window"),
    31                 Shortcut.registerShortcut("menu:windows:changesetdialog",
    32                         tr("Toggle visibility of Changeset Manager window"), KeyEvent.VK_C, Shortcut.ALT_CTRL),
    33                 true /* register shortcut */, "dialogs/changeset/changesetmanager", false);
     28        super(false);
     29        setName(tr("Changeset Manager"));
     30        setIcon(new ImageProvider("dialogs/changeset/changesetmanager").setOptional(true));
     31        setShortcut(Shortcut.registerShortcut("menu:windows:changesetdialog",
     32                tr("Toggle visibility of Changeset Manager window"), KeyEvent.VK_C, Shortcut.ALT_CTRL));
     33        setTooltip(tr("Toggle visibility of Changeset Manager window"));
     34        registerInToolbar("dialogs/changeset/changesetmanager");
    3435        notifySelectedState();
    3536        changesetCacheManagerClosedHandler = new ChangesetCacheManagerClosedHandler();
    3637        setHelpId(ht("/Dialog/ChangesetManager"));
  • src/org/openstreetmap/josm/actions/CloseChangesetAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CloseChangesetAction.java b/src/org/openstreetmap/josm/actions/CloseChangesetAction.java
    index 02e8c0d45..cfb6948f0 100644
    a b  
    4545     * Constructs a new {@code CloseChangesetAction}.
    4646     */
    4747    public CloseChangesetAction() {
    48         super(tr("Close open changesets..."),
    49             "closechangeset",
    50             tr("Close open changesets"),
    51             Shortcut.registerShortcut("system:closechangeset",
    52                 tr("File: {0}", tr("Close open changesets")),
    53                 KeyEvent.VK_Q, Shortcut.ALT_CTRL),
    54             true, false
    55         );
     48        super(false);
     49        setName(tr("Close open changesets..."));
     50        setIcon("closechangeset");
     51        setShortcut(Shortcut.registerShortcut("system:closechangeset", tr("File: {0}", tr("Close open changesets")),
     52                KeyEvent.VK_Q, Shortcut.ALT_CTRL));
     53        setTooltip(tr("Close open changesets"));
     54        registerInToolbar("closechangeset");
    5655        setHelpId(ht("/Action/CloseChangeset"));
    5756        setEnabled(!NetworkManager.isOffline(OnlineResource.OSM_API));
    5857
  • src/org/openstreetmap/josm/actions/CombineWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CombineWayAction.java b/src/org/openstreetmap/josm/actions/CombineWayAction.java
    index 1cfa93010..89f10fa38 100644
    a b  
    6262     * Constructs a new {@code CombineWayAction}.
    6363     */
    6464    public CombineWayAction() {
    65         super(tr("Combine Way"), "combineway", tr("Combine several ways into one."),
    66                 Shortcut.registerShortcut("tools:combineway", tr("Tool: {0}", tr("Combine Way")), KeyEvent.VK_C, Shortcut.DIRECT), true);
     65        setName(tr("Combine Way"));
     66        setIcon("combineway");
     67        setShortcut(Shortcut.registerShortcut("tools:combineway", tr("Tool: {0}", tr("Combine Way")), KeyEvent.VK_C, Shortcut.DIRECT));
     68        setTooltip(tr("Combine several ways into one."));
     69        registerInToolbar("combineway");
    6770        setHelpId(ht("/Action/CombineWay"));
    6871    }
    6972
  • src/org/openstreetmap/josm/actions/CopyAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CopyAction.java b/src/org/openstreetmap/josm/actions/CopyAction.java
    index 4eeacea9a..8d7faac10 100644
    a b  
    3030     * Constructs a new {@code CopyAction}.
    3131     */
    3232    public CopyAction() {
    33         super(tr("Copy"), "copy",
    34                 tr("Copy selected objects to paste buffer."),
    35                 Shortcut.registerShortcut("system:copy", tr("Edit: {0}", tr("Copy")), KeyEvent.VK_C, Shortcut.CTRL), true);
     33        setName(tr("Copy"));
     34        setIcon("copy");
     35        setShortcut(Shortcut.registerShortcut("system:copy", tr("Edit: {0}", tr("Copy")), KeyEvent.VK_C, Shortcut.CTRL));
     36        setTooltip(tr("Copy selected objects to paste buffer."));
     37        registerInToolbar("copy");
    3638        setHelpId(ht("/Action/Copy"));
    3739        // CUA shortcut for copy (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
    3840        MainApplication.registerActionShortcut(this,
  • src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java b/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java
    index 7fc45ff7c..7e0e9bc58 100644
    a b  
    2727     * Constructs a new {@code CopyCoordinatesAction}.
    2828     */
    2929    public CopyCoordinatesAction() {
    30         super(tr("Copy Coordinates"), null,
    31                 tr("Copy coordinates of selected nodes to clipboard."),
    32                 Shortcut.registerShortcut("copy:coordinates", tr("Edit: {0}", tr("Copy Coordinates")),
    33                 KeyEvent.VK_C, Shortcut.CTRL_SHIFT),
    34                 false);
     30        setName(tr("Copy Coordinates"));
     31        setShortcut(Shortcut.registerShortcut("copy:coordinates", tr("Edit: {0}", tr("Copy Coordinates")), KeyEvent.VK_C, Shortcut.CTRL_SHIFT));
     32        setTooltip(tr("Copy coordinates of selected nodes to clipboard."));
    3533        setToolbarId("copy/coordinates");
    3634    }
    3735
  • src/org/openstreetmap/josm/actions/CreateCircleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CreateCircleAction.java b/src/org/openstreetmap/josm/actions/CreateCircleAction.java
    index 594167bc2..e3e541942 100644
    a b  
    5656     * Constructs a new {@code CreateCircleAction}.
    5757     */
    5858    public CreateCircleAction() {
    59         super(tr("Create Circle"), "aligncircle", tr("Create a circle from three selected nodes."),
    60             Shortcut.registerShortcut("tools:createcircle", tr("Tool: {0}", tr("Create Circle")),
    61             KeyEvent.VK_O, Shortcut.SHIFT), true, "createcircle", true);
     59        setName(tr("Create Circle"));
     60        setIcon("aligncircle");
     61        setShortcut(Shortcut.registerShortcut("tools:createcircle", tr("Tool: {0}", tr("Create Circle")), KeyEvent.VK_O, Shortcut.SHIFT));
     62        setTooltip(tr("Create a circle from three selected nodes."));
     63        registerInToolbar("createcircle");
    6264        setHelpId(ht("/Action/CreateCircle"));
    6365    }
    6466
  • src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    diff --git a/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java b/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
    index 0bc9f4958..badf05c54 100644
    a b  
    7979     * @param update {@code true} if the multipolygon must be updated, {@code false} if it must be created
    8080     */
    8181    public CreateMultipolygonAction(final boolean update) {
    82         super(getName(update), /* ICON */ "multipoly_create", getName(update),
    83                 /* at least three lines for each shortcut or the server extractor fails */
    84                 update ? Shortcut.registerShortcut("tools:multipoly_update",
    85                             tr("Tool: {0}", getName(true)),
    86                             KeyEvent.VK_B, Shortcut.CTRL_SHIFT)
    87                        : Shortcut.registerShortcut("tools:multipoly_create",
    88                             tr("Tool: {0}", getName(false)),
    89                             KeyEvent.VK_B, Shortcut.CTRL),
    90                 true, update ? "multipoly_update" : "multipoly_create", true);
     82        setName(getName(update));
     83        setTooltip(getName(update));
     84        setIcon(/* ICON */ "multipoly_create");
     85
     86        /* at least three lines for each shortcut or the server extractor fails */
     87        setShortcut(update ? Shortcut.registerShortcut("tools:multipoly_update",
     88                    tr("Tool: {0}", getName(true)),
     89                    KeyEvent.VK_B, Shortcut.CTRL_SHIFT)
     90               : Shortcut.registerShortcut("tools:multipoly_create",
     91                    tr("Tool: {0}", getName(false)),
     92                    KeyEvent.VK_B, Shortcut.CTRL));
     93        registerInToolbar(update ? "multipoly_update" : "multipoly_create");
    9194        this.update = update;
    9295    }
    9396
  • src/org/openstreetmap/josm/actions/DeleteAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DeleteAction.java b/src/org/openstreetmap/josm/actions/DeleteAction.java
    index a3c556b76..1b345c903 100644
    a b public boolean confirmDeletionFromRelation(Collection<RelationToChildReference>  
    6060     * Constructs a new {@code DeleteAction}.
    6161     */
    6262    public DeleteAction() {
    63         super(tr("Delete"), "dialogs/delete", tr("Delete selected objects."),
    64                 Shortcut.registerShortcut("system:delete", tr("Edit: {0}", tr("Delete")), KeyEvent.VK_DELETE, Shortcut.DIRECT), true);
     63        setName(tr("Delete"));
     64        setIcon("dialogs/delete");
     65        setShortcut(Shortcut.registerShortcut("system:delete", tr("Edit: {0}", tr("Delete")), KeyEvent.VK_DELETE, Shortcut.DIRECT));
     66        setTooltip(tr("Delete selected objects."));
     67        registerInToolbar("dialogs/delete");
    6568        setHelpId(ht("/Action/Delete"));
    6669    }
    6770
  • src/org/openstreetmap/josm/actions/DeleteLayerAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DeleteLayerAction.java b/src/org/openstreetmap/josm/actions/DeleteLayerAction.java
    index e4fc253c2..972e0845d 100644
    a b  
    2121     * Constructs a {@link DeleteLayerAction} which will delete the active layer.
    2222     */
    2323    public DeleteLayerAction() {
    24         super(tr("Delete Layer"), "dialogs/delete", tr("Delete the active layer. Does not delete the associated file."),
    25                 Shortcut.registerShortcut("system:deletelayer", tr("File: {0}", tr("Delete Layer")), KeyEvent.VK_F4, Shortcut.CTRL),
    26                 true, "delete-layer", true);
     24        setName(tr("Delete Layer"));
     25        setIcon("dialogs/delete");
     26        setShortcut(Shortcut.registerShortcut("system:deletelayer", tr("File: {0}", tr("Delete Layer")), KeyEvent.VK_F4, Shortcut.CTRL));
     27        setTooltip(tr("Delete the active layer. Does not delete the associated file."));
     28        registerInToolbar("delete-layer");
    2729        setHelpId(ht("/Action/DeleteLayer"));
    2830    }
    2931
  • src/org/openstreetmap/josm/actions/DialogsToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DialogsToggleAction.java b/src/org/openstreetmap/josm/actions/DialogsToggleAction.java
    index d53e22fbc..a2673a02b 100644
    a b  
    1010import org.openstreetmap.josm.gui.MainApplication;
    1111import org.openstreetmap.josm.gui.MapFrame;
    1212import org.openstreetmap.josm.spi.preferences.Config;
    13 import org.openstreetmap.josm.tools.ImageProvider;
    1413import org.openstreetmap.josm.tools.Shortcut;
    1514
    1615/**
     
    2726     * Constructs a new {@code DialogsToggleAction}.
    2827     */
    2928    public DialogsToggleAction() {
    30         super(tr("Dialogs panel"),
    31               (ImageProvider) null, /* no icon */
    32               tr("Toggle dialogs panel, maximize mapview"),
    33               Shortcut.registerShortcut("menu:view:dialogspanel", tr("Toggle dialogs panel"), KeyEvent.VK_TAB, Shortcut.DIRECT),
    34               true, "dialogspanel", /* register in toolbar */
    35               false
    36         );
     29        super(false);
     30        setName(tr("Dialogs panel"));
     31        setShortcut(Shortcut.registerShortcut("menu:view:dialogspanel", tr("Toggle dialogs panel"), KeyEvent.VK_TAB, Shortcut.DIRECT));
     32        setTooltip(tr("Toggle dialogs panel, maximize mapview"));
     33        registerInToolbar("dialogspanel");
    3734        setHelpId(ht("/ToggleDialogs"));
    3835        setSelected(Config.getPref().getBoolean("draw.dialogspanel", true));
    3936        notifySelectedState();
  • src/org/openstreetmap/josm/actions/DiskAccessAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DiskAccessAction.java b/src/org/openstreetmap/josm/actions/DiskAccessAction.java
    index c09fb2b7a..a9a1806bd 100644
    a b  
    1616 */
    1717public abstract class DiskAccessAction extends JosmAction {
    1818
     19    /**
     20     * Constructs a new {@code DiskAccessAction}.
     21     * @param installAdapters False, if you don't want to install layer changed and selection changed adapters
     22     */
     23    public DiskAccessAction(boolean installAdapters) {
     24        super(installAdapters);
     25    }
     26
    1927    /**
    2028     * Constructs a new {@code DiskAccessAction}.
    2129     *
     
    2432     * @param tooltip A longer description of the action that will be displayed in the tooltip
    2533     * @param shortcut A ready-created shortcut object or {@code null} if you don't want a shortcut
    2634     * @since 1084
     35     * @deprecated use {@link #DiskAccessAction(boolean)} and setters
    2736     */
     37    @Deprecated
    2838    public DiskAccessAction(String name, String iconName, String tooltip, Shortcut shortcut) {
    2939        super(name, iconName, tooltip, shortcut, true);
    3040    }
    public DiskAccessAction(String name, String iconName, String tooltip, Shortcut s  
    4050     * @param toolbarId Identifier for the toolbar preferences. The iconName is used, if this parameter is null
    4151     * @param installAdapters False, if you don't want to install layer changed and selection changed adapters
    4252     * @since 5438
     53     * @deprecated use {@link #DiskAccessAction(boolean)} and setters
    4354     */
     55    @Deprecated
    4456    public DiskAccessAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register,
    4557            String toolbarId, boolean installAdapters) {
    4658        super(name, iconName, tooltip, shortcut, register, toolbarId, installAdapters);
  • src/org/openstreetmap/josm/actions/DistributeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DistributeAction.java b/src/org/openstreetmap/josm/actions/DistributeAction.java
    index fbc536f2e..0c50d9318 100644
    a b  
    3737     * Constructs a new {@code DistributeAction}.
    3838     */
    3939    public DistributeAction() {
    40         super(tr("Distribute Nodes"), "distribute",
    41               tr("Distribute the selected nodes to equal distances along a line."),
    42               Shortcut.registerShortcut("tools:distribute", tr("Tool: {0}", tr("Distribute Nodes")), KeyEvent.VK_B, Shortcut.SHIFT),
    43               true);
     40        setName(tr("Distribute Nodes"));
     41        setIcon("distribute");
     42        setShortcut(Shortcut.registerShortcut("tools:distribute", tr("Tool: {0}", tr("Distribute Nodes")), KeyEvent.VK_B, Shortcut.SHIFT));
     43        setTooltip(tr("Distribute the selected nodes to equal distances along a line."));
     44        registerInToolbar("distribute");
    4445        setHelpId(ht("/Action/DistributeNodes"));
    4546    }
    4647
  • src/org/openstreetmap/josm/actions/DownloadAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadAction.java b/src/org/openstreetmap/josm/actions/DownloadAction.java
    index f70cd1a6d..7519c3992 100644
    a b  
    2424     * Constructs a new {@code DownloadAction}.
    2525     */
    2626    public DownloadAction() {
    27         super(tr("Download data..."), "download", tr("Download map data from a server of your choice"),
    28               Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download data")), KeyEvent.VK_DOWN, Shortcut.CTRL_SHIFT),
    29               true, false);
     27        super(false);
     28        setName(tr("Download data..."));
     29        setIcon("download");
     30        setShortcut(Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download data")), KeyEvent.VK_DOWN, Shortcut.CTRL_SHIFT));
     31        setTooltip(tr("Download map data from a server of your choice"));
     32        registerInToolbar("download");
    3033        setHelpId(ht("/Action/Download"));
    3134    }
    3235
  • src/org/openstreetmap/josm/actions/DownloadAlongAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadAlongAction.java b/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
    index 17bd45fd1..9a9aaa55f 100644
    a b  
    3232import org.openstreetmap.josm.spi.preferences.Config;
    3333import org.openstreetmap.josm.tools.GBC;
    3434import org.openstreetmap.josm.tools.Logging;
    35 import org.openstreetmap.josm.tools.Shortcut;
    3635import org.openstreetmap.josm.tools.Utils;
    3736
    3837/**
     
    4746     */
    4847    protected abstract PleaseWaitRunnable createTask();
    4948
    50     /**
    51      * Constructs a new {@code DownloadAlongAction}
    52      * @param name the action's text as displayed in the menu
    53      * @param iconName the filename of the icon to use
    54      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    55      *           that html is not supported for menu actions on some platforms.
    56      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    57      *            do want a shortcut, remember you can always register it with group=none, so you
    58      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    59      *            the user CANNOT configure a shortcut for your action.
    60      * @param registerInToolbar register this action for the toolbar preferences?
    61      */
    62     public DownloadAlongAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
    63         super(name, iconName, tooltip, shortcut, registerInToolbar);
    64     }
    65 
    6649    protected static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double maxArea) {
    6750        Area tmp = new Area(r);
    6851        // intersect with sought-after area
  • src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java b/src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java
    index 0a30bccb0..a8f9cfa98 100644
    a b  
    3535     * Create new {@link DownloadAlongWayAction}.
    3636     */
    3737    public DownloadAlongWayAction() {
    38         super(tr("Download along..."), "download_along_way", tr("Download OSM data along the selected ways."),
    39                 Shortcut.registerShortcut("file:download_along", tr("File: {0}", tr("Download Along")),
    40                         KeyEvent.VK_D, Shortcut.ALT_SHIFT), true);
     38        setName(tr("Download along..."));
     39        setIcon("download_along_way");
     40        setShortcut(Shortcut.registerShortcut("file:download_along", tr("File: {0}", tr("Download Along")), KeyEvent.VK_D, Shortcut.ALT_SHIFT));
     41        setTooltip(tr("Download OSM data along the selected ways."));
     42        registerInToolbar("download_along_way");
    4143    }
    4244
    4345    @Override
  • src/org/openstreetmap/josm/actions/DownloadNotesInViewAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadNotesInViewAction.java b/src/org/openstreetmap/josm/actions/DownloadNotesInViewAction.java
    index 7c2f68a94..e94936785 100644
    a b  
    2222public final class DownloadNotesInViewAction extends JosmAction {
    2323
    2424    private DownloadNotesInViewAction(String iconName) {
    25         super(tr("Download notes in current view"), iconName, tr("Download notes in current view"), null, false,
    26                 "dialogs/notes/download_in_view", true);
     25        setName(tr("Download notes in current view"));
     26        setIcon(iconName);
     27        setTooltip(tr("Download notes in current view"));
     28        setToolbarId("dialogs/notes/download_in_view");
    2729    }
    2830
    2931    /**
  • src/org/openstreetmap/josm/actions/DownloadOsmInViewAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadOsmInViewAction.java b/src/org/openstreetmap/josm/actions/DownloadOsmInViewAction.java
    index 0108a9dae..fb8bfc644 100644
    a b  
    2626     * Creates a new {@code DownloadOsmInViewAction}.
    2727     */
    2828    public DownloadOsmInViewAction() {
    29         super(tr("Download in current view"), "download_in_view", tr("Download map data from the OSM server in current view"), null, false,
    30                 "dialogs/download_in_view", true);
     29        setName(tr("Download in current view"));
     30        setIcon("download_in_view");
     31        setTooltip(tr("Download map data from the OSM server in current view"));
     32        setToolbarId("dialogs/download_in_view");
    3133    }
    3234
    3335    @Override
  • src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java b/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
    index 263bf1ff6..e4e18507d 100644
    a b  
    3232     * Constructs a new {@code DownloadPrimitiveAction}.
    3333     */
    3434    public DownloadPrimitiveAction() {
    35         super(tr("Download object..."), "downloadprimitive", tr("Download OSM object by ID"),
    36                 SHORTCUT, true, false);
     35        super(false);
     36        setName(tr("Download object..."));
     37        setIcon("downloadprimitive");
     38        setShortcut(SHORTCUT);
     39        setTooltip(tr("Download OSM object by ID"));
     40        registerInToolbar("downloadprimitive");
    3741        setHelpId(ht("/Action/DownloadObject"));
    3842    }
    3943
  • src/org/openstreetmap/josm/actions/DownloadReferrersAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java b/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
    index 69ac3d8e6..13d5b3dab 100644
    a b  
    2525     * Constructs a new {@code DownloadReferrersAction}.
    2626     */
    2727    public DownloadReferrersAction() {
    28         super(tr("Download parent ways/relations..."), "download",
    29                 tr("Download objects referring to one of the selected objects"),
    30                 Shortcut.registerShortcut("file:downloadreferrers",
    31                         tr("File: {0}", tr("Download parent ways/relations...")), KeyEvent.VK_D, Shortcut.ALT_CTRL),
    32                 true, "downloadreferrers", true);
     28        setName(tr("Download parent ways/relations..."));
     29        setIcon("download");
     30        setShortcut(Shortcut.registerShortcut("file:downloadreferrers",
     31                tr("File: {0}", tr("Download parent ways/relations...")), KeyEvent.VK_D, Shortcut.ALT_CTRL));
     32        setTooltip(tr("Download objects referring to one of the selected objects"));
     33        registerInToolbar("downloadreferrers");
    3334        setHelpId(ht("/Action/DownloadParentWaysAndRelation"));
    3435    }
    3536
  • src/org/openstreetmap/josm/actions/DuplicateAction.java

    diff --git a/src/org/openstreetmap/josm/actions/DuplicateAction.java b/src/org/openstreetmap/josm/actions/DuplicateAction.java
    index 0918a773c..9ba84922a 100644
    a b  
    2323     * Constructs a new {@code DuplicateAction}.
    2424     */
    2525    public DuplicateAction() {
    26         super(tr("Duplicate"), "duplicate",
    27                 tr("Duplicate selection."),
    28                 Shortcut.registerShortcut("system:duplicate", tr("Edit: {0}", tr("Duplicate")), KeyEvent.VK_D, Shortcut.CTRL), true);
     26        setName(tr("Duplicate"));
     27        setIcon("duplicate");
     28        setShortcut(Shortcut.registerShortcut("system:duplicate", tr("Edit: {0}", tr("Duplicate")), KeyEvent.VK_D, Shortcut.CTRL));
     29        setTooltip(tr("Duplicate selection."));
     30        registerInToolbar("duplicate");
    2931        setHelpId(ht("/Action/Duplicate"));
    3032    }
    3133
  • src/org/openstreetmap/josm/actions/ExitAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ExitAction.java b/src/org/openstreetmap/josm/actions/ExitAction.java
    index 2e010cfc6..9aa368d80 100644
    a b  
    2020     * Construct the action with "Exit" as label
    2121     */
    2222    public ExitAction() {
    23         super(tr("Exit"), "exit", tr("Exit the application."),
    24                 Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.CTRL), true, false);
     23        super(false);
     24        setName(tr("Exit"));
     25        setIcon("exit");
     26        setShortcut(Shortcut.registerShortcut("system:menuexit", tr("Exit"), KeyEvent.VK_Q, Shortcut.CTRL));
     27        setTooltip(tr("Exit the application."));
     28        registerInToolbar("exit");
    2529        setHelpId(ht("/Action/Exit"));
    2630    }
    2731
  • src/org/openstreetmap/josm/actions/ExpertToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ExpertToggleAction.java b/src/org/openstreetmap/josm/actions/ExpertToggleAction.java
    index 76c6e6837..4838a672d 100644
    a b  
    77import java.awt.event.ActionEvent;
    88
    99import org.openstreetmap.josm.data.preferences.BooleanProperty;
    10 import org.openstreetmap.josm.gui.MainApplication;
    1110import org.openstreetmap.josm.tools.ImageProvider;
    1211import org.openstreetmap.josm.tools.ListenerList;
    1312
    public static synchronized boolean hasVisibilitySwitcher(Component c) {  
    109108     * Constructs a new {@code ExpertToggleAction}.
    110109     */
    111110    public ExpertToggleAction() {
    112         super(tr("Expert Mode"),
    113                 new ImageProvider("expert").setOptional(true),
    114               tr("Enable/disable expert mode"),
    115               null,
    116               false /* register toolbar */, null, false
    117         );
    118         setToolbarId("expertmode");
    119         if (MainApplication.getToolbar() != null) {
    120             MainApplication.getToolbar().register(this);
    121         }
     111        super(false);
     112        setName(tr("Expert Mode"));
     113        setIcon(new ImageProvider("expert").setOptional(true));
     114        setTooltip(tr("Enable/disable expert mode"));
     115        registerInToolbar("expertmode");
    122116        setSelected(PREF_EXPERT.get());
    123117        notifySelectedState();
    124118    }
  • src/org/openstreetmap/josm/actions/FollowLineAction.java

    diff --git a/src/org/openstreetmap/josm/actions/FollowLineAction.java b/src/org/openstreetmap/josm/actions/FollowLineAction.java
    index 3783bce34..a8cf356d7 100644
    a b  
    4040     * Constructs a new {@code FollowLineAction}.
    4141     */
    4242    public FollowLineAction() {
    43         super(
    44                 tr("Follow line"),
    45                 "followline",
    46                 tr("Continues drawing a line that shares nodes with another line."),
    47                 Shortcut.registerShortcut("tools:followline", tr(
    48                 "Tool: {0}", tr("Follow")),
    49                 KeyEvent.VK_F, Shortcut.DIRECT), true);
     43        setName(tr("Follow line"));
     44        setIcon("followline");
     45        setShortcut(Shortcut.registerShortcut("tools:followline", tr("Tool: {0}", tr("Follow")), KeyEvent.VK_F, Shortcut.DIRECT));
     46        setTooltip(tr("Continues drawing a line that shares nodes with another line."));
     47        registerInToolbar("followline");
    5048    }
    5149
    5250    @Override
  • src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java b/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
    index 25e888b0d..ab3104d00 100644
    a b  
    3636     * Constructs a new {@code FullscreenToggleAction}.
    3737     */
    3838    public FullscreenToggleAction() {
    39         super(tr("Fullscreen view"),
    40               null, /* no icon */
    41               tr("Toggle fullscreen view"),
    42               Shortcut.registerShortcut("menu:view:fullscreen", tr("Toggle fullscreen view"), KeyEvent.VK_F11, Shortcut.DIRECT),
    43               false /* register */, null, false
    44         );
     39        super(false);
     40        setName(tr("Fullscreen view"));
     41        setShortcut(Shortcut.registerShortcut("menu:view:fullscreen", tr("Toggle fullscreen view"), KeyEvent.VK_F11, Shortcut.DIRECT));
     42        setTooltip(tr("Toggle fullscreen view"));
    4543        setHelpId(ht("/Action/FullscreenView"));
    46         setToolbarId("fullscreen");
    47         MainApplication.getToolbar().register(this);
     44        registerInToolbar("fullscreen");
    4845        gd = GraphicsEnvironment.isHeadless() ? null : GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    4946        setSelected(Config.getPref().getBoolean("draw.fullscreen", false));
    5047        notifySelectedState();
  • src/org/openstreetmap/josm/actions/GpxExportAction.java

    diff --git a/src/org/openstreetmap/josm/actions/GpxExportAction.java b/src/org/openstreetmap/josm/actions/GpxExportAction.java
    index 601ec619e..5301d83f0 100644
    a b  
    3333     * Constructs a new {@code GpxExportAction}.
    3434     */
    3535    public GpxExportAction() {
    36         super(tr("Export to GPX..."), "exportgpx", tr("Export the data to GPX file."),
    37                 Shortcut.registerShortcut("file:exportgpx", tr("Export to GPX..."), KeyEvent.VK_E, Shortcut.CTRL));
     36        super(true);
     37        setName(tr("Export to GPX..."));
     38        setIcon("exportgpx");
     39        setShortcut(Shortcut.registerShortcut("file:exportgpx", tr("Export to GPX..."), KeyEvent.VK_E, Shortcut.CTRL));
     40        setTooltip(tr("Export the data to GPX file."));
     41        registerInToolbar("exportgpx");
    3842        setHelpId(ht("/Action/GpxExport"));
    3943    }
    4044
    4145    /**
    4246     * Deferring constructor for child classes.
    4347     *
    44      * @param name see {@code DiskAccessAction}
    45      * @param iconName see {@code DiskAccessAction}
    46      * @param tooltip see {@code DiskAccessAction}
    47      * @param shortcut see {@code DiskAccessAction}
    48      * @param register see {@code DiskAccessAction}
    49      * @param toolbarId see {@code DiskAccessAction}
    5048     * @param installAdapters see {@code DiskAccessAction}
    5149     *
    5250     * @since 13210
    5351     */
    54     protected GpxExportAction(String name, String iconName, String tooltip, Shortcut shortcut,
    55             boolean register, String toolbarId, boolean installAdapters) {
    56         super(name, iconName, tooltip, shortcut, register, toolbarId, installAdapters);
     52    protected GpxExportAction(boolean installAdapters) {
     53        super(installAdapters);
    5754    }
    5855
    5956    /**
  • src/org/openstreetmap/josm/actions/HelpAction.java

    diff --git a/src/org/openstreetmap/josm/actions/HelpAction.java b/src/org/openstreetmap/josm/actions/HelpAction.java
    index fa2c4b9da..e0e04f32d 100644
    a b public HelpAction() {  
    3232    }
    3333
    3434    private HelpAction(boolean shortcut) {
    35         super(tr("Help"), "help", null,
    36                 shortcut ? Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, Shortcut.DIRECT) : null,
    37                 true, false);
     35        super(false);
     36        setName(tr("Help"));
     37        setIcon("help");
     38        setShortcut(shortcut ? Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, Shortcut.DIRECT) : null);
     39        registerInToolbar("help");
    3840        setEnabled(!NetworkManager.isOffline(OnlineResource.JOSM_WEBSITE));
    3941    }
    4042
  • src/org/openstreetmap/josm/actions/HistoryInfoAction.java

    diff --git a/src/org/openstreetmap/josm/actions/HistoryInfoAction.java b/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
    index d0a01cdd0..21d3debe9 100644
    a b  
    3535     * Constructs a new {@code HistoryInfoAction}.
    3636     */
    3737    public HistoryInfoAction() {
    38         super(tr("History"), "dialogs/history",
    39                 tr("Display history information about OSM ways, nodes, or relations."),
    40                 SHORTCUT, true, "action/historyinfo", false);
     38        super(false);
     39        setName(tr("History"));
     40        setIcon("dialogs/history");
     41        setShortcut(SHORTCUT);
     42        setTooltip(tr("Display history information about OSM ways, nodes, or relations."));
     43        registerInToolbar("action/historyinfo");
    4144        setHelpId(ht("/Action/ObjectHistory"));
    4245        setEnabled(true);
    4346    }
  • src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java

    diff --git a/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java b/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java
    index 860b9f928..f9a05b09f 100644
    a b  
    2121     * Constructs a new {@code HistoryInfoWebAction}.
    2222     */
    2323    public HistoryInfoWebAction() {
    24         super(tr("History (web)"), "dialogs/history",
    25                 tr("Display history information about OSM ways, nodes, or relations in web browser."),
    26                 Shortcut.registerShortcut("core:historyinfoweb",
    27                         tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT),
    28                 true, "action/historyinfoweb", true);
     24        super(true);
     25        setName(tr("History (web)"));
     26        setIcon("dialogs/history");
     27        setShortcut(Shortcut.registerShortcut("core:historyinfoweb", tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT));
     28        setTooltip(tr("Display history information about OSM ways, nodes, or relations in web browser."));
     29        registerInToolbar("action/historyinfoweb");
    2930        setHelpId(ht("/Action/ObjectHistoryWeb"));
    3031    }
    3132
  • src/org/openstreetmap/josm/actions/InfoAction.java

    diff --git a/src/org/openstreetmap/josm/actions/InfoAction.java b/src/org/openstreetmap/josm/actions/InfoAction.java
    index da04f5718..8cb398e90 100644
    a b  
    2323     * Constructs a new {@code InfoAction}.
    2424     */
    2525    public InfoAction() {
    26         super(tr("Advanced info"), "info",
    27             tr("Display advanced object information about OSM nodes, ways, or relations."),
    28             Shortcut.registerShortcut("core:info",
    29                 tr("Advanced info"), KeyEvent.VK_I, Shortcut.CTRL),
    30             true, "action/info", true);
     26        setName(tr("Advanced info"));
     27        setIcon("info");
     28        setShortcut(Shortcut.registerShortcut("core:info", tr("Advanced info"), KeyEvent.VK_I, Shortcut.CTRL));
     29        setTooltip(tr("Display advanced object information about OSM nodes, ways, or relations."));
     30        registerInToolbar("action/info");
    3131        setHelpId(ht("/Action/InfoAboutElements"));
    3232    }
    3333
  • src/org/openstreetmap/josm/actions/InfoWebAction.java

    diff --git a/src/org/openstreetmap/josm/actions/InfoWebAction.java b/src/org/openstreetmap/josm/actions/InfoWebAction.java
    index 53c4d6f2f..92182b539 100644
    a b  
    2525     * Constructs a new {@code InfoWebAction}.
    2626     */
    2727    public InfoWebAction() {
    28         super(tr("Advanced info (web)"), "info",
    29                 tr("Display object information about OSM nodes, ways, or relations in web browser."),
    30                 Shortcut.registerShortcut("core:infoweb",
    31                         tr("Advanced info (web)"), KeyEvent.VK_I, Shortcut.CTRL_SHIFT),
    32                 true, "action/infoweb", true);
     28        super(true);
     29        setName(tr("Advanced info (web)"));
     30        setIcon("info");
     31        setShortcut(Shortcut.registerShortcut("core:infoweb", tr("Advanced info (web)"), KeyEvent.VK_I, Shortcut.CTRL_SHIFT));
     32        setTooltip(tr("Display object information about OSM nodes, ways, or relations in web browser."));
     33        registerInToolbar("action/infoweb");
    3334        setHelpId(ht("/Action/InfoAboutElementsWeb"));
    3435    }
    3536
  • src/org/openstreetmap/josm/actions/JoinAreasAction.java

    diff --git a/src/org/openstreetmap/josm/actions/JoinAreasAction.java b/src/org/openstreetmap/josm/actions/JoinAreasAction.java
    index 2f9bf7ee0..a5e04ffb4 100644
    a b public JoinAreasAction() {  
    466466     * @since 11611
    467467     */
    468468    public JoinAreasAction(boolean addShortcutToolbarAdapters) {
    469         super(tr("Join overlapping Areas"), "joinareas", tr("Joins areas that overlap each other"), addShortcutToolbarAdapters ?
    470         Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")), KeyEvent.VK_J, Shortcut.SHIFT)
    471         : null, addShortcutToolbarAdapters, null, addShortcutToolbarAdapters);
     469        super(addShortcutToolbarAdapters);
     470        setName(tr("Join overlapping Areas"));
     471        setIcon("joinareas");
     472        setTooltip(tr("Joins areas that overlap each other"));
     473        setToolbarId("joinareas");
     474        if (addShortcutToolbarAdapters) {
     475            setShortcut(Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")),
     476                    KeyEvent.VK_J, Shortcut.SHIFT));
     477            registerInToolbar("joinareas");
     478        }
    472479        addUndoRedo = addShortcutToolbarAdapters;
    473480    }
    474481
  • src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java b/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
    index 8f4180fa5..4c15f90bf 100644
    a b  
    5252
    5353    protected final boolean joinWayToNode;
    5454
    55     protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName, String tooltip,
    56             Shortcut shortcut, boolean registerInToolbar) {
    57         super(name, iconName, tooltip, shortcut, registerInToolbar);
     55    protected JoinNodeWayAction(boolean joinWayToNode) {
    5856        this.joinWayToNode = joinWayToNode;
    5957    }
    6058
    protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName,  
    6361     * @return the Join Node to Way action
    6462     */
    6563    public static JoinNodeWayAction createJoinNodeToWayAction() {
    66         JoinNodeWayAction action = new JoinNodeWayAction(false,
    67                 tr("Join Node to Way"), /* ICON */ "joinnodeway",
    68                 tr("Include a node into the nearest way segments"),
    69                 Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")),
    70                         KeyEvent.VK_J, Shortcut.DIRECT), true);
     64        JoinNodeWayAction action = new JoinNodeWayAction(false);
     65        action.setName(tr("Join Node to Way"));
     66        action.setIcon(/* ICON */ "joinnodeway");
     67        action.setShortcut(Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")),
     68                KeyEvent.VK_J, Shortcut.DIRECT));
     69        action.setTooltip(tr("Include a node into the nearest way segments"));
     70        action.registerInToolbar("joinnodeway");
    7171        action.setHelpId(ht("/Action/JoinNodeWay"));
    7272        return action;
    7373    }
    public static JoinNodeWayAction createJoinNodeToWayAction() {  
    7777     * @return the Move Node onto Way action
    7878     */
    7979    public static JoinNodeWayAction createMoveNodeOntoWayAction() {
    80         JoinNodeWayAction action = new JoinNodeWayAction(true,
    81                 tr("Move Node onto Way"), /* ICON*/ "movenodeontoway",
    82                 tr("Move the node onto the nearest way segments and include it"),
    83                 Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")),
    84                         KeyEvent.VK_N, Shortcut.DIRECT), true);
     80        JoinNodeWayAction action = new JoinNodeWayAction(true);
     81        action.setName(tr("Move Node onto Way"));
     82        action.setIcon(/* ICON*/ "movenodeontoway");
     83        action.setShortcut(Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")),
     84                KeyEvent.VK_N, Shortcut.DIRECT));
     85        action.setTooltip(tr("Move the node onto the nearest way segments and include it"));
     86        action.registerInToolbar("movenodeontoway");
    8587        action.setHelpId(ht("/Action/MoveNodeWay"));
    8688        return action;
    8789    }
  • src/org/openstreetmap/josm/actions/JosmAction.java

    diff --git a/src/org/openstreetmap/josm/actions/JosmAction.java b/src/org/openstreetmap/josm/actions/JosmAction.java
    index 3a5b8bc69..107e6f40b 100644
    a b  
    66import java.awt.GridBagLayout;
    77import java.awt.event.KeyEvent;
    88import java.util.Collection;
    9 import java.util.List;
    109import java.util.concurrent.CancellationException;
    1110import java.util.concurrent.ExecutionException;
    1211import java.util.concurrent.Future;
     
    3130import org.openstreetmap.josm.gui.layer.MainLayerManager;
    3231import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
    3332import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
     33import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
    3434import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
    3535import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
    3636import org.openstreetmap.josm.tools.Destroyable;
     
    7777     * @param registerInToolbar register this action for the toolbar preferences?
    7878     * @param toolbarId identifier for the toolbar preferences
    7979     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     80     * @deprecated use {@link #JosmAction(boolean)} and setters
    8081     */
     82    @Deprecated
    8183    public JosmAction(String name, ImageProvider icon, String tooltip, Shortcut shortcut, boolean registerInToolbar,
    8284            String toolbarId, boolean installAdapters) {
    83         super(name);
    84         if (icon != null) {
    85             ImageResource resource = icon.getResource();
    86             if (resource != null) {
    87                 try {
    88                     resource.attachImageIcon(this, true);
    89                 } catch (RuntimeException e) {
    90                     Logging.warn("Unable to attach image icon {0} for action {1}", icon, name);
    91                     Logging.error(e);
    92                 }
    93             }
    94         }
    95         setHelpId();
    96         sc = shortcut;
    97         if (sc != null && !sc.isAutomatic()) {
    98             MainApplication.registerActionShortcut(this, sc);
    99         }
     85        this(installAdapters);
     86        setName(name);
     87        setIcon(icon);
     88        setShortcut(shortcut);
    10089        setTooltip(tooltip);
    101         if (getValue("toolbar") == null) {
     90        if (toolbarId != null && registerInToolbar) {
     91            registerInToolbar(toolbarId);
     92        } else if (toolbarId != null) {
    10293            setToolbarId(toolbarId);
    10394        }
    104         if (registerInToolbar && MainApplication.getToolbar() != null) {
    105             MainApplication.getToolbar().register(this);
    106         }
    107         if (installAdapters) {
    108             installAdapters();
    109         }
    11095    }
    11196
    11297    /**
    public JosmAction(String name, ImageProvider icon, String tooltip, Shortcut shor  
    125110     * @param registerInToolbar register this action for the toolbar preferences?
    126111     * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    127112     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     113     * @deprecated use {@link #JosmAction(boolean)} and setters
    128114     */
     115    @Deprecated
    129116    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar,
    130117            String toolbarId, boolean installAdapters) {
    131         this(name, iconName == null ? null : new ImageProvider(iconName).setOptional(true), tooltip, shortcut, registerInToolbar,
    132                 toolbarId == null ? iconName : toolbarId, installAdapters);
     118        this(installAdapters);
     119        setName(name);
     120        setIcon(iconName);
     121        setShortcut(shortcut);
     122        setTooltip(tooltip);
     123        if (registerInToolbar) {
     124            registerInToolbar(toolbarId == null ? iconName : toolbarId);
     125        } else {
     126            setToolbarId(toolbarId == null ? iconName : toolbarId);
     127        }
    133128    }
    134129
    135130    /**
    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcu  
    147142     *            the user CANNOT configure a shortcut for your action.
    148143     * @param registerInToolbar register this action for the toolbar preferences?
    149144     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     145     * @deprecated use {@link #JosmAction(boolean)} and setters
    150146     */
     147    @Deprecated
    151148    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar, boolean installAdapters) {
    152         this(name, iconName, tooltip, shortcut, registerInToolbar, null, installAdapters);
     149        this(installAdapters);
     150        setName(name);
     151        setIcon(iconName);
     152        setShortcut(shortcut);
     153        setTooltip(tooltip);
     154        if (registerInToolbar) {
     155            registerInToolbar(iconName);
     156        } else {
     157            setToolbarId(iconName);
     158        }
    153159    }
    154160
    155161    /**
    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcu  
    166172     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    167173     *            the user CANNOT configure a shortcut for your action.
    168174     * @param registerInToolbar register this action for the toolbar preferences?
     175     * @deprecated use setters
    169176     */
     177    @Deprecated
    170178    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
    171         this(name, iconName, tooltip, shortcut, registerInToolbar, null, true);
     179        setName(name);
     180        setIcon(iconName);
     181        setShortcut(shortcut);
     182        setTooltip(tooltip);
     183        if (registerInToolbar) {
     184            registerInToolbar(iconName);
     185        } else {
     186            setToolbarId(iconName);
     187        }
    172188    }
    173189
    174190    /**
    public JosmAction() {  
    182198     * Constructs a new {@code JosmAction}.
    183199     *
    184200     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     201     * @see #setName(String)
     202     * @see #setIcon(String)
     203     * @see #setIcon(ImageProvider)
     204     * @see #setShortcut(Shortcut)
     205     * @see #setTooltip(String)
     206     * @see #setHelpId(String)
     207     * @see #registerInToolbar(String)
    185208     */
    186209    public JosmAction(boolean installAdapters) {
    187210        setHelpId();
    public JosmAction(boolean installAdapters) {  
    191214    }
    192215
    193216    /**
    194      * Constructs a new {@code JosmAction}.
    195      *
    196      * Use this super constructor to setup your action.
    197      *
     217     * Sets the name
    198218     * @param name the action's text as displayed on the menu (if it is added to a menu)
     219     */
     220    protected final void setName(String name) {
     221        putValue(NAME, name);
     222    }
     223
     224    /**
     225     * Sets the toolbar identifier and registers this action in the toolbar
     226     *
     227     * @param toolbarId identifier for the toolbar preferences
     228     * @see ToolbarPreferences#register(javax.swing.Action)
     229     */
     230    protected final void registerInToolbar(String toolbarId) {
     231        setToolbarId(toolbarId);
     232        if (MainApplication.getToolbar() != null) {
     233            MainApplication.getToolbar().register(this);
     234        }
     235    }
     236
     237    /**
     238     * Sets the shortcut
     239     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
     240     *                 do want a shortcut, remember you can always register it with group=none, so you
     241     *                 won't be assigned a shortcut unless the user configures one. If you pass null here,
     242     *                 the user CANNOT configure a shortcut for your action.
     243     */
     244    protected final void setShortcut(Shortcut shortcut) {
     245        sc = shortcut;
     246        if (sc != null && !sc.isAutomatic()) {
     247            MainApplication.registerActionShortcut(this, sc);
     248        }
     249    }
     250
     251    /**
     252     * Sets the icon name
    199253     * @param iconName the filename of the icon to use
    200      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    201      *           that html is not supported for menu actions on some platforms.
    202      * @param shortcuts ready-created shortcut objects
    203      * @since 14012
    204254     */
    205     public JosmAction(String name, String iconName, String tooltip, List<Shortcut> shortcuts) {
    206         this(name, iconName, tooltip, shortcuts.get(0), true, null, true);
    207         for (int i = 1; i < shortcuts.size(); i++) {
    208             MainApplication.registerActionShortcut(this, shortcuts.get(i));
     255    protected final void setIcon(String iconName) {
     256        if (iconName == null) {
     257            return;
     258        }
     259        ImageProvider icon = new ImageProvider(iconName).setOptional(true);
     260        setIcon(icon);
     261    }
     262
     263    /**
     264     * Sets the icon
     265     * @param icon the icon to use
     266     */
     267    protected final void setIcon(ImageProvider icon) {
     268        if (icon == null) {
     269            return;
     270        }
     271        ImageResource resource = icon.getResource();
     272        if (resource == null) {
     273            return;
     274        }
     275        try {
     276            resource.attachImageIcon(this, true);
     277        } catch (RuntimeException e) {
     278            Logging.warn("Unable to attach image icon {0} for action {1}", icon, getValue(NAME));
     279            Logging.error(e);
    209280        }
    210281    }
    211282
    protected void setHelpId(String helpId) {  
    304375    /**
    305376     * Sets the toolbar id.
    306377     * @param toolbarId toolbar id
     378     * @see #registerInToolbar(String)
    307379     * @since 16138
    308380     */
    309381    protected void setToolbarId(String toolbarId) {
    public Shortcut getShortcut() {  
    326398
    327399    /**
    328400     * Sets the tooltip text of this action.
     401     * Make sure to call {@link #setShortcut(Shortcut)} first to have the shortcut included in the tooltip.
    329402     * @param tooltip The text to display in tooltip. Can be {@code null}
    330403     */
    331404    public final void setTooltip(String tooltip) {
  • src/org/openstreetmap/josm/actions/JumpToAction.java

    diff --git a/src/org/openstreetmap/josm/actions/JumpToAction.java b/src/org/openstreetmap/josm/actions/JumpToAction.java
    index 313d86a6e..90280b6ac 100644
    a b  
    3232import org.openstreetmap.josm.io.NameFinder;
    3333import org.openstreetmap.josm.spi.preferences.Config;
    3434import org.openstreetmap.josm.tools.GBC;
    35 import org.openstreetmap.josm.tools.ImageProvider;
    3635import org.openstreetmap.josm.tools.Logging;
    3736import org.openstreetmap.josm.tools.OsmUrlToBounds;
    3837import org.openstreetmap.josm.tools.Shortcut;
     
    5352     * Constructs a new {@code JumpToAction}.
    5453     */
    5554    public JumpToAction() {
    56         super(tr("Jump to Position"), (ImageProvider) null, tr("Opens a dialog that allows to jump to a specific location"),
    57                 Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump to Position")),
    58                         KeyEvent.VK_J, Shortcut.CTRL), true, "action/jumpto", false);
     55        setName(tr("Jump to Position"));
     56        setShortcut(Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump to Position")),
     57                        KeyEvent.VK_J, Shortcut.CTRL));
     58        setTooltip(tr("Opens a dialog that allows to jump to a specific location"));
     59        registerInToolbar("action/jumpto");
    5960        // make this action listen to mapframe change events
    6061        MainApplication.addMapFrameListener((o, n) -> updateEnabledState());
    6162
  • src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java b/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
    index eff64286a..b919ae395 100644
    a b private boolean isSelected() {  
    8080     * Constructs a new {@code MapRectifierWMSmenuAction}.
    8181     */
    8282    public MapRectifierWMSmenuAction() {
    83         super(tr("Rectified Image..."),
    84                 "OLmarker",
    85                 tr("Download Rectified Images From Various Services"),
    86                 Shortcut.registerShortcut("imagery:rectimg",
    87                         tr("Imagery: {0}", tr("Rectified Image...")),
    88                         KeyEvent.CHAR_UNDEFINED, Shortcut.NONE),
    89                 true
    90         );
     83        setName(tr("Rectified Image..."));
     84        setIcon("OLmarker");
     85        setShortcut(Shortcut.registerShortcut("imagery:rectimg", tr("Imagery: {0}", tr("Rectified Image...")),
     86                KeyEvent.CHAR_UNDEFINED, Shortcut.NONE));
     87        setTooltip(tr("Download Rectified Images From Various Services"));
     88        registerInToolbar("OLmarker");
    9189        setHelpId(ht("/Menu/Imagery"));
    9290
    9391        // Add default services
  • src/org/openstreetmap/josm/actions/MergeLayerAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MergeLayerAction.java b/src/org/openstreetmap/josm/actions/MergeLayerAction.java
    index a12634d19..8403e5e63 100644
    a b  
    3636     * Constructs a new {@code MergeLayerAction}.
    3737     */
    3838    public MergeLayerAction() {
    39         super(tr("Merge layer"), "dialogs/mergedown",
    40             tr("Merge the current layer into another layer"),
    41             Shortcut.registerShortcut("system:merge", tr("Edit: {0}",
    42             tr("Merge")), KeyEvent.VK_M, Shortcut.CTRL),
    43             true, "action/mergelayer", true);
     39        setName(tr("Merge layer"));
     40        setIcon("dialogs/mergedown");
     41        setShortcut(Shortcut.registerShortcut("system:merge", tr("Edit: {0}", tr("Merge")), KeyEvent.VK_M, Shortcut.CTRL));
     42        setTooltip(tr("Merge the current layer into another layer"));
     43        registerInToolbar("action/mergelayer");
    4444        setHelpId(ht("/Action/MergeLayer"));
    4545    }
    4646
  • src/org/openstreetmap/josm/actions/MergeNodesAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MergeNodesAction.java b/src/org/openstreetmap/josm/actions/MergeNodesAction.java
    index a48b2d245..09e2467ad 100644
    a b  
    6666     * Constructs a new {@code MergeNodesAction}.
    6767     */
    6868    public MergeNodesAction() {
    69         super(tr("Merge Nodes"), "mergenodes", tr("Merge nodes into the oldest one."),
    70                 Shortcut.registerShortcut("tools:mergenodes", tr("Tool: {0}", tr("Merge Nodes")), KeyEvent.VK_M, Shortcut.DIRECT), true);
     69        setName(tr("Merge Nodes"));
     70        setIcon("mergenodes");
     71        setShortcut(Shortcut.registerShortcut("tools:mergenodes", tr("Tool: {0}", tr("Merge Nodes")), KeyEvent.VK_M, Shortcut.DIRECT));
     72        setTooltip(tr("Merge nodes into the oldest one."));
     73        registerInToolbar("mergenodes");
    7174        setHelpId(ht("/Action/MergeNodes"));
    7275    }
    7376
  • src/org/openstreetmap/josm/actions/MergeSelectionAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MergeSelectionAction.java b/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
    index 7e33b4f9a..29a69bd52 100644
    a b  
    2929     * Constructs a new {@code MergeSelectionAction}.
    3030     */
    3131    public MergeSelectionAction() {
    32         super(tr("Merge selection"), "dialogs/mergedown", tr("Merge the currently selected objects into another layer"),
    33             Shortcut.registerShortcut("system:mergeselection", tr("Edit: {0}", tr("Merge selection")),
    34             KeyEvent.VK_M, Shortcut.CTRL_SHIFT),
    35             true /* register */
    36         );
     32        setName(tr("Merge selection"));
     33        setIcon("dialogs/mergedown");
     34        setShortcut(Shortcut.registerShortcut("system:mergeselection", tr("Edit: {0}", tr("Merge selection")),
     35                KeyEvent.VK_M, Shortcut.CTRL_SHIFT));
     36        setTooltip(tr("Merge the currently selected objects into another layer"));
     37        registerInToolbar("dialogs/mergedown");
    3738        setHelpId(ht("/Action/MergeSelection"));
    3839    }
    3940
  • src/org/openstreetmap/josm/actions/MirrorAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MirrorAction.java b/src/org/openstreetmap/josm/actions/MirrorAction.java
    index 8d152151c..031cfaff4 100644
    a b  
    3636     * Constructs a new {@code MirrorAction}.
    3737     */
    3838    public MirrorAction() {
    39         super(tr("Mirror"), "mirror", tr("Mirror selected nodes and ways."),
    40                 Shortcut.registerShortcut("tools:mirror", tr("Tool: {0}", tr("Mirror")),
    41                         KeyEvent.VK_M, Shortcut.SHIFT), true);
     39        setName(tr("Mirror"));
     40        setIcon("mirror");
     41        setShortcut(Shortcut.registerShortcut("tools:mirror", tr("Tool: {0}", tr("Mirror")), KeyEvent.VK_M, Shortcut.SHIFT));
     42        setTooltip(tr("Mirror selected nodes and ways."));
     43        registerInToolbar("mirror");
    4244        setHelpId(ht("/Action/Mirror"));
    4345    }
    4446
  • src/org/openstreetmap/josm/actions/MoveAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MoveAction.java b/src/org/openstreetmap/josm/actions/MoveAction.java
    index 568341ee4..02d0cbf1f 100644
    a b Shortcut getShortcut() {  
    8989     * @param dir direction
    9090     */
    9191    public MoveAction(Direction dir) {
    92         super(tr("Move {0}", dir.getLocalizedName()), dir.getIcon(),
    93                 tr("Moves Objects {0}", dir.getLocalizedName()),
    94                 dir.getShortcut(), true, dir.getToolbarName(), true);
     92        setName(tr("Move {0}", dir.getLocalizedName()));
     93        setIcon(dir.getIcon());
     94        setShortcut(dir.getShortcut());
     95        setTooltip(tr("Moves Objects {0}", dir.getLocalizedName()));
     96        registerInToolbar(dir.getToolbarName());
    9597        myDirection = dir;
    9698        setHelpId(ht("/Action/Move"));
    9799    }
  • src/org/openstreetmap/josm/actions/MoveNodeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/MoveNodeAction.java b/src/org/openstreetmap/josm/actions/MoveNodeAction.java
    index edffab05e..7364331fa 100644
    a b  
    2828     * Constructs a new {@code MoveNodeAction}.
    2929     */
    3030    public MoveNodeAction() {
    31         super(tr("Move Node..."), "movenode", tr("Edit latitude and longitude of a node."),
    32                 Shortcut.registerShortcut("movenode", tr("Edit: {0}", tr("Move Node...")),
    33                         KeyEvent.VK_M, Shortcut.NONE), true);
     31        setName(tr("Move Node..."));
     32        setIcon("movenode");
     33        setShortcut(Shortcut.registerShortcut("movenode", tr("Edit: {0}", tr("Move Node...")), KeyEvent.VK_M, Shortcut.NONE));
     34        setTooltip(tr("Edit latitude and longitude of a node."));
     35        registerInToolbar("movenode");
    3436        setHelpId(ht("/Action/MoveNode"));
    3537    }
    3638
  • src/org/openstreetmap/josm/actions/NewAction.java

    diff --git a/src/org/openstreetmap/josm/actions/NewAction.java b/src/org/openstreetmap/josm/actions/NewAction.java
    index 21861d375..9f512689b 100644
    a b  
    2121     * Constructs a {@code NewAction}.
    2222     */
    2323    public NewAction() {
    24         super(tr("New Layer"), "new", tr("Create a new map layer."),
    25                 Shortcut.registerShortcut("system:new", tr("File: {0}", tr("New Layer")), KeyEvent.VK_N, Shortcut.CTRL), true, false);
     24        super(false);
     25        setName(tr("New Layer"));
     26        setIcon("new");
     27        setShortcut(Shortcut.registerShortcut("system:new", tr("File: {0}", tr("New Layer")), KeyEvent.VK_N, Shortcut.CTRL));
     28        setTooltip(tr("Create a new map layer."));
     29        registerInToolbar("new");
    2630        setHelpId(ht("/Action/NewLayer"));
    2731    }
    2832
  • src/org/openstreetmap/josm/actions/OpenFileAction.java

    diff --git a/src/org/openstreetmap/josm/actions/OpenFileAction.java b/src/org/openstreetmap/josm/actions/OpenFileAction.java
    index 5e5f4d028..1599f7955 100644
    a b  
    6565     * Create an open action. The name is "Open a file".
    6666     */
    6767    public OpenFileAction() {
    68         super(tr("Open..."), "open", tr("Open a file."),
    69                 Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.CTRL),
    70                 true, null, false);
     68        super(false);
     69        setName(tr("Open..."));
     70        setIcon("open");
     71        setShortcut(Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.CTRL));
     72        setTooltip(tr("Open a file."));
     73        registerInToolbar("open");
    7174        setHelpId(ht("/Action/Open"));
    7275    }
    7376
  • src/org/openstreetmap/josm/actions/OpenLocationAction.java

    diff --git a/src/org/openstreetmap/josm/actions/OpenLocationAction.java b/src/org/openstreetmap/josm/actions/OpenLocationAction.java
    index 823f57103..34ca98127 100644
    a b  
    8383     * Create an open action. The name is "Open a file".
    8484     */
    8585    public OpenLocationAction() {
     86        super(false);
    8687        /* I18N: Command to download a specific location/URL */
    87         super(tr("Open Location..."), "openlocation", tr("Open an URL."),
    88                 Shortcut.registerShortcut("system:open_location", tr("File: {0}", tr("Open Location...")),
    89                         KeyEvent.VK_L, Shortcut.CTRL), true, false);
     88        setName(tr("Open Location..."));
     89        setIcon("openlocation");
     90        setShortcut(Shortcut.registerShortcut("system:open_location", tr("File: {0}", tr("Open Location...")), KeyEvent.VK_L, Shortcut.CTRL));
     91        setTooltip(tr("Open an URL."));
     92        registerInToolbar("openlocation");
    9093        setHelpId(ht("/Action/OpenLocation"));
    9194        this.downloadTasks = new ArrayList<>();
    9295        addDownloadTaskClass(DownloadOsmTask.class);
  • src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java b/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
    index 2500af15d..12dba64a7 100644
    a b  
    6060     * Constructs a new {@code OrthogonalizeAction}.
    6161     */
    6262    public OrthogonalizeAction() {
    63         super(tr("Orthogonalize Shape"),
    64                 "ortho",
    65                 tr("Move nodes so all angles are 90 or 180 degrees"),
    66                 Shortcut.registerShortcut("tools:orthogonalize", tr("Tool: {0}", tr("Orthogonalize Shape")),
    67                         KeyEvent.VK_Q,
    68                         Shortcut.DIRECT), true);
     63        setName(tr("Orthogonalize Shape"));
     64        setIcon("ortho");
     65        setShortcut(Shortcut.registerShortcut("tools:orthogonalize", tr("Tool: {0}", tr("Orthogonalize Shape")),
     66                KeyEvent.VK_Q, Shortcut.DIRECT));
     67        setTooltip(tr("Move nodes so all angles are 90 or 180 degrees"));
     68        registerInToolbar("ortho");
    6969        setHelpId(ht("/Action/OrthogonalizeShape"));
    7070    }
    7171
    public OrthogonalizeAction() {  
    9696         * Constructor
    9797         */
    9898        public Undo() {
    99             super(tr("Orthogonalize Shape / Undo"), "ortho",
    100                     tr("Undo orthogonalization for certain nodes"),
    101                     Shortcut.registerShortcut("tools:orthogonalizeUndo", tr("Tool: {0}", tr("Orthogonalize Shape / Undo")),
    102                             KeyEvent.VK_Q,
    103                             Shortcut.SHIFT),
    104                     true, "action/orthogonalize/undo", true);
     99            setName(tr("Orthogonalize Shape / Undo"));
     100            setIcon("ortho");
     101            setShortcut(Shortcut.registerShortcut("tools:orthogonalizeUndo", tr("Tool: {0}", tr("Orthogonalize Shape / Undo")),
     102                    KeyEvent.VK_Q, Shortcut.SHIFT));
     103            setTooltip(tr("Undo orthogonalization for certain nodes"));
     104            registerInToolbar("action/orthogonalize/undo");
    105105        }
    106106
    107107        @Override
  • src/org/openstreetmap/josm/actions/PasteAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PasteAction.java b/src/org/openstreetmap/josm/actions/PasteAction.java
    index 960ee45b5..0374c1cfa 100644
    a b  
    2020     * Constructs a new {@code PasteAction}.
    2121     */
    2222    public PasteAction() {
    23         super(tr("Paste"), "paste", tr("Paste contents of clipboard."),
    24                 Shortcut.registerShortcut("system:paste", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_V, Shortcut.CTRL), true);
     23        setName(tr("Paste"));
     24        setIcon("paste");
     25        setShortcut(Shortcut.registerShortcut("system:paste", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_V, Shortcut.CTRL));
     26        setTooltip(tr("Paste contents of clipboard."));
     27        registerInToolbar("paste");
    2528        setHelpId(ht("/Action/Paste"));
    2629        // CUA shortcut for paste (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
    2730        MainApplication.registerActionShortcut(this,
  • src/org/openstreetmap/josm/actions/PasteAtSourcePositionAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PasteAtSourcePositionAction.java b/src/org/openstreetmap/josm/actions/PasteAtSourcePositionAction.java
    index 70ddb2d11..839f4e716 100644
    a b  
    2121     * Constructs a new {@link PasteAtSourcePositionAction}.
    2222     */
    2323    public PasteAtSourcePositionAction() {
    24         super(tr("Paste at source position"), "paste", tr("Paste contents of clipboard at the position they were copied from."),
    25                 Shortcut.registerShortcut("menu:edit:pasteAtSource", tr("Edit: {0}", tr("Paste at source position")),
    26                         KeyEvent.VK_V, Shortcut.ALT_CTRL), true, "pasteatsource");
     24        setName(tr("Paste at source position"));
     25        setIcon("paste");
     26        setShortcut(Shortcut.registerShortcut("menu:edit:pasteAtSource", tr("Edit: {0}", tr("Paste at source position")),
     27                KeyEvent.VK_V, Shortcut.ALT_CTRL));
     28        setTooltip(tr("Paste contents of clipboard at the position they were copied from."));
     29        registerInToolbar("pasteatsource");
    2730        setHelpId(ht("/Action/Paste"));
    2831    }
    2932
  • src/org/openstreetmap/josm/actions/PasteTagsAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PasteTagsAction.java b/src/org/openstreetmap/josm/actions/PasteTagsAction.java
    index 48beb83b9..e426724f8 100644
    a b  
    2929     * Constructs a new {@code PasteTagsAction}.
    3030     */
    3131    public PasteTagsAction() {
    32         super(tr("Paste Tags"), "pastetags",
    33                 tr("Apply tags of contents of paste buffer to all selected items."),
    34                 Shortcut.registerShortcut("system:pastestyle", tr("Edit: {0}", tr("Paste Tags")),
    35                 KeyEvent.VK_V, Shortcut.CTRL_SHIFT), true);
     32        setName(tr("Paste Tags"));
     33        setIcon("pastetags");
     34        setShortcut(Shortcut.registerShortcut("system:pastestyle", tr("Edit: {0}", tr("Paste Tags")), KeyEvent.VK_V, Shortcut.CTRL_SHIFT));
     35        setTooltip(tr("Apply tags of contents of paste buffer to all selected items."));
     36        registerInToolbar("pastetags");
    3637        setHelpId(HELP);
    3738    }
    3839
  • src/org/openstreetmap/josm/actions/PreferenceToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PreferenceToggleAction.java b/src/org/openstreetmap/josm/actions/PreferenceToggleAction.java
    index 3bf6ff91d..9d79069af 100644
    a b  
    2828     * @param pref the preference to toggle
    2929     */
    3030    public PreferenceToggleAction(String name, String tooltip, BooleanProperty pref) {
    31         super(name, null, tooltip, null, false);
     31        setName(name);
     32        setTooltip(tooltip);
    3233        setToolbarId("toggle-" + pref.getKey());
    3334        this.pref = pref;
    3435        checkbox = new JCheckBoxMenuItem(this);
  • src/org/openstreetmap/josm/actions/PreferencesAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PreferencesAction.java b/src/org/openstreetmap/josm/actions/PreferencesAction.java
    index 471174309..80d282faf 100644
    a b  
    2727
    2828    private PreferencesAction(String name, String icon, String tooltip,
    2929                              Class<? extends TabPreferenceSetting> tab, Class<? extends SubPreferenceSetting> subTab) {
    30         super(name, icon, tooltip, null, false, "preference_" + Utils.<Class<?>>firstNonNull(tab, subTab).getName(), false);
     30        super(false);
     31        setName(name);
     32        setIcon(icon);
     33        setTooltip(tooltip);
     34        setToolbarId("preference_" + Utils.<Class<?>>firstNonNull(tab, subTab).getName());
    3135        this.tab = tab;
    3236        this.subTab = subTab;
    3337    }
    public static PreferencesAction forPreferenceSubTab(String name, String tooltip,  
    8690     * Create the preference action with "Preferences" as label.
    8791     */
    8892    public PreferencesAction() {
    89         super(tr("Preferences..."), "preference", tr("Open a preferences dialog for global settings."),
    90                 Shortcut.registerShortcut("system:preferences", tr("Preferences"), KeyEvent.VK_F12, Shortcut.DIRECT), true, false);
     93        super(false);
     94        setName(tr("Preferences..."));
     95        setIcon("preference");
     96        setShortcut(Shortcut.registerShortcut("system:preferences", tr("Preferences"), KeyEvent.VK_F12, Shortcut.DIRECT));
     97        setTooltip(tr("Open a preferences dialog for global settings."));
     98        registerInToolbar("preference");
    9199        setHelpId(ht("/Action/Preferences"));
    92100        this.tab = null;
    93101        this.subTab = null;
  • src/org/openstreetmap/josm/actions/PurgeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PurgeAction.java b/src/org/openstreetmap/josm/actions/PurgeAction.java
    index c3305bb51..59fae99c8 100644
    a b  
    6969     */
    7070    public PurgeAction() {
    7171        /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */
    72         super(tr("Purge..."), "purge", tr("Forget objects but do not delete them on server when uploading."),
    73                 Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.CTRL_SHIFT),
    74                 true);
     72        setName(tr("Purge..."));
     73        setIcon("purge");
     74        setShortcut(Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.CTRL_SHIFT));
     75        setTooltip(tr("Forget objects but do not delete them on server when uploading."));
     76        registerInToolbar("purge");
    7577        setHelpId(HelpUtil.ht("/Action/Purge"));
    7678    }
    7779
  • src/org/openstreetmap/josm/actions/RedoAction.java

    diff --git a/src/org/openstreetmap/josm/actions/RedoAction.java b/src/org/openstreetmap/josm/actions/RedoAction.java
    index 36284fb81..66443cd2c 100644
    a b  
    2424     * Construct the action with "Redo" as label.
    2525     */
    2626    public RedoAction() {
    27         super(tr("Redo"), "redo", tr("Redo the last undone action."),
    28                 Shortcut.registerShortcut("system:redo", tr("Edit: {0}", tr("Redo")), KeyEvent.VK_Y, Shortcut.CTRL), true);
     27        setName(tr("Redo"));
     28        setIcon("redo");
     29        setShortcut(Shortcut.registerShortcut("system:redo", tr("Edit: {0}", tr("Redo")), KeyEvent.VK_Y, Shortcut.CTRL));
     30        setTooltip(tr("Redo the last undone action."));
     31        registerInToolbar("redo");
    2932        setEnabled(false);
    3033        setHelpId(ht("/Action/Redo"));
    3134    }
  • src/org/openstreetmap/josm/actions/ReorderImageryLayersAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ReorderImageryLayersAction.java b/src/org/openstreetmap/josm/actions/ReorderImageryLayersAction.java
    index 0013696be..efbd21fa9 100644
    a b  
    88import java.util.stream.Collectors;
    99import java.util.stream.Stream;
    1010
     11import org.openstreetmap.josm.gui.MainApplication;
    1112import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1213import org.openstreetmap.josm.tools.KeyboardUtils;
    1314import org.openstreetmap.josm.tools.Shortcut;
     
    2223     * Constructs a new {@code ReorderImageryLayersAction}.
    2324     */
    2425    public ReorderImageryLayersAction() {
    25         super(tr("Reorder imagery layers"), "dialogs/reorderlayers", tr("Reorders non-overlay imagery layers."),
    26             Shortcut.registerMultiShortcuts("imagery:reorder", tr("Reorder imagery layers"),
    27                     KeyboardUtils.getCharactersForKey('E', 0), Shortcut.DIRECT));
     26        setName(tr("Reorder imagery layers"));
     27        setIcon("dialogs/reorderlayers");
     28        setTooltip(tr("Reorders non-overlay imagery layers."));
     29        registerInToolbar("dialogs/reorderlayers");
     30        List<Shortcut> shortcuts = Shortcut.registerMultiShortcuts("imagery:reorder", tr("Reorder imagery layers"),
     31                KeyboardUtils.getCharactersForKey('E', 0), Shortcut.DIRECT);
     32        setShortcut(shortcuts.get(0));
     33        for (int i = 1; i < shortcuts.size(); i++) {
     34            MainApplication.registerActionShortcut(this, shortcuts.get(i));
     35        }
    2836    }
    2937
    3038    @Override
  • src/org/openstreetmap/josm/actions/ReportBugAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ReportBugAction.java b/src/org/openstreetmap/josm/actions/ReportBugAction.java
    index 336fb37ce..e5105880c 100644
    a b public ReportBugAction() {  
    2929     * @param text The text to send
    3030     */
    3131    public ReportBugAction(String text) {
    32         super(tr("Report bug"), "bug", tr("Report a ticket to JOSM bugtracker"),
    33                 Shortcut.registerShortcut("reportbug", tr("Report a ticket to JOSM bugtracker"),
    34                         KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true, false);
     32        super(false);
     33        setName(tr("Report bug"));
     34        setIcon("bug");
     35        setShortcut(Shortcut.registerShortcut("reportbug", tr("Report a ticket to JOSM bugtracker"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE));
     36        setTooltip(tr("Report a ticket to JOSM bugtracker"));
     37        registerInToolbar("bug");
    3538        this.text = text;
    3639    }
    3740
  • src/org/openstreetmap/josm/actions/RestartAction.java

    diff --git a/src/org/openstreetmap/josm/actions/RestartAction.java b/src/org/openstreetmap/josm/actions/RestartAction.java
    index 7d35582bd..830d7b071 100644
    a b  
    4747     * Constructs a new {@code RestartAction}.
    4848     */
    4949    public RestartAction() {
    50         super(tr("Restart"), "restart", tr("Restart the application."),
    51                 Shortcut.registerShortcut("file:restart", tr("File: {0}", tr("Restart")), KeyEvent.VK_J, Shortcut.ALT_CTRL_SHIFT), false, false);
     50        super(false);
     51        setName(tr("Restart"));
     52        setIcon("restart");
     53        setShortcut(Shortcut.registerShortcut("file:restart", tr("File: {0}", tr("Restart")), KeyEvent.VK_J, Shortcut.ALT_CTRL_SHIFT));
     54        setTooltip(tr("Restart the application."));
     55        setToolbarId("restart");
    5256        setHelpId(ht("/Action/Restart"));
    53         setToolbarId("action/restart");
    54         if (MainApplication.getToolbar() != null) {
    55             MainApplication.getToolbar().register(this);
    56         }
     57        registerInToolbar("action/restart");
    5758        setEnabled(isRestartSupported());
    5859    }
    5960
  • src/org/openstreetmap/josm/actions/ReverseWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ReverseWayAction.java b/src/org/openstreetmap/josm/actions/ReverseWayAction.java
    index 75d714c4e..f17b275c3 100644
    a b public Command getReverseCommand() {  
    104104     * Creates a new {@link ReverseWayAction} and binds the shortcut
    105105     */
    106106    public ReverseWayAction() {
    107         super(tr("Reverse Ways"), "wayflip", tr("Reverse the direction of all selected ways."),
    108                 Shortcut.registerShortcut("tools:reverse", tr("Tool: {0}", tr("Reverse Ways")), KeyEvent.VK_R, Shortcut.DIRECT), true);
     107        setName(tr("Reverse Ways"));
     108        setIcon("wayflip");
     109        setShortcut(Shortcut.registerShortcut("tools:reverse", tr("Tool: {0}", tr("Reverse Ways")), KeyEvent.VK_R, Shortcut.DIRECT));
     110        setTooltip(tr("Reverse the direction of all selected ways."));
     111        registerInToolbar("wayflip");
    109112        setHelpId(ht("/Action/ReverseWays"));
    110113    }
    111114
  • src/org/openstreetmap/josm/actions/SaveAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SaveAction.java b/src/org/openstreetmap/josm/actions/SaveAction.java
    index 1eb7293df..a6b5b9af7 100644
    a b  
    4848     * Construct the action with "Save" as label.
    4949     */
    5050    private SaveAction() {
    51         super(tr("Save"), "save", tr("Save the current data."),
    52                 Shortcut.registerShortcut("system:save", tr("File: {0}", tr("Save")), KeyEvent.VK_S, Shortcut.CTRL),
    53                 true);
     51        super(true);
     52        setName(tr("Save"));
     53        setIcon("save");
     54        setShortcut(Shortcut.registerShortcut("system:save", tr("File: {0}", tr("Save")), KeyEvent.VK_S, Shortcut.CTRL));
     55        setTooltip(tr("Save the current data."));
     56        registerInToolbar("save");
    5457        setHelpId(ht("/Action/Save"));
    5558    }
    5659
  • src/org/openstreetmap/josm/actions/SaveActionBase.java

    diff --git a/src/org/openstreetmap/josm/actions/SaveActionBase.java b/src/org/openstreetmap/josm/actions/SaveActionBase.java
    index a7df83856..1805b6388 100644
    a b  
    4242     * @param iconName The filename of the icon to use
    4343     * @param tooltip A longer description of the action that will be displayed in the tooltip
    4444     * @param shortcut A ready-created shortcut object or {@code null} if you don't want a shortcut
     45     * @deprecated use {@link #SaveActionBase(boolean)} and setters
    4546     */
     47    @Deprecated
    4648    public SaveActionBase(String name, String iconName, String tooltip, Shortcut shortcut) {
    4749        super(name, iconName, tooltip, shortcut);
    4850    }
    public SaveActionBase(String name, String iconName, String tooltip, Shortcut sho  
    5557     * @param shortcut A ready-created shortcut object or {@code null} if you don't want a shortcut
    5658     * @param quiet whether the quiet exporter is called
    5759     * @since 15496
     60     * @deprecated use {@link #SaveActionBase(boolean)} and setters
    5861     */
     62    @Deprecated
    5963    public SaveActionBase(String name, String iconName, String tooltip, Shortcut shortcut, boolean quiet) {
    6064        super(name, iconName, tooltip, shortcut);
    6165        this.quiet = quiet;
    6266    }
    6367
     68    /**
     69     * Constructs a new {@code SaveActionBase}.
     70     * @param quiet whether the quiet exporter is called
     71     */
     72    public SaveActionBase(boolean quiet) {
     73        super(true);
     74        this.quiet = quiet;
     75    }
     76
    6477    @Override
    6578    public void actionPerformed(ActionEvent e) {
    6679        if (!isEnabled())
  • src/org/openstreetmap/josm/actions/SaveAsAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SaveAsAction.java b/src/org/openstreetmap/josm/actions/SaveAsAction.java
    index 1615711af..676f07045 100644
    a b  
    2222     * Construct the action with "Save" as label.
    2323     */
    2424    public SaveAsAction() {
    25         super(tr("Save As..."), "save_as", tr("Save the current data to a new file."),
    26             Shortcut.registerShortcut("system:saveas", tr("File: {0}", tr("Save As...")),
    27             KeyEvent.VK_S, Shortcut.CTRL_SHIFT), false);
     25        super(false);
     26        setName(tr("Save As..."));
     27        setIcon("save_as");
     28        setShortcut(Shortcut.registerShortcut("system:saveas", tr("File: {0}", tr("Save As...")), KeyEvent.VK_S, Shortcut.CTRL_SHIFT));
     29        setTooltip(tr("Save the current data to a new file."));
     30        registerInToolbar("save_as");
    2831        setHelpId(ht("/Action/SaveAs"));
    2932    }
    3033
  • src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java b/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java
    index cdde8b15a..41ec9b00c 100644
    a b  
    3434
    3535    /** Constructs a new note search action */
    3636    public SearchNotesDownloadAction() {
    37         super(tr("Search Notes..."), "note_search", tr("Download notes from the note search API"), null, false, false);
     37        super(false);
     38        setName(tr("Search Notes..."));
     39        setIcon("note_search");
     40        setTooltip(tr("Download notes from the note search API"));
     41        setToolbarId("note_search");
    3842    }
    3943
    4044    @Override
  • src/org/openstreetmap/josm/actions/SelectAllAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SelectAllAction.java b/src/org/openstreetmap/josm/actions/SelectAllAction.java
    index b13f057a6..27ed48705 100644
    a b  
    1919     * Constructs a new {@code SelectAllAction}.
    2020     */
    2121    public SelectAllAction() {
    22         super(tr("Select All"), "selectall", tr("Select all undeleted objects in the data layer. This selects incomplete objects too."),
    23                 Shortcut.registerShortcut("system:selectall", tr("Edit: {0}", tr("Select All")), KeyEvent.VK_A, Shortcut.CTRL), true);
     22        setName(tr("Select All"));
     23        setIcon("selectall");
     24        setShortcut(Shortcut.registerShortcut("system:selectall", tr("Edit: {0}", tr("Select All")), KeyEvent.VK_A, Shortcut.CTRL));
     25        setTooltip(tr("Select all undeleted objects in the data layer. This selects incomplete objects too."));
     26        registerInToolbar("selectall");
    2427        setHelpId(ht("/Action/SelectAll"));
    2528    }
    2629
  • src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequencesAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequencesAction.java b/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequencesAction.java
    index c6116a6f2..89b1448ee 100644
    a b  
    2020     * Creates a new {@link SelectNonBranchingWaySequencesAction}
    2121     */
    2222    public SelectNonBranchingWaySequencesAction() {
    23         super(tr("Non-branching way sequences"),
    24                 "way-select",
    25                 tr("Select non-branching sequences of ways"),
    26                 Shortcut.registerShortcut("wayselector:wayselect", tr("Non-branching way sequences"), KeyEvent.VK_W, Shortcut.SHIFT),
    27                 true);
     23        setName(tr("Non-branching way sequences"));
     24        setIcon("way-select");
     25        setShortcut(Shortcut.registerShortcut("wayselector:wayselect", tr("Non-branching way sequences"), KeyEvent.VK_W, Shortcut.SHIFT));
     26        setTooltip(tr("Select non-branching sequences of ways"));
     27        registerInToolbar("way-select");
    2828    }
    2929
    3030    @Override
  • src/org/openstreetmap/josm/actions/SessionLoadAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SessionLoadAction.java b/src/org/openstreetmap/josm/actions/SessionLoadAction.java
    index 491d3764c..58ee5911b 100644
    a b  
    4949     * Constructs a new {@code SessionLoadAction}.
    5050     */
    5151    public SessionLoadAction() {
    52         super(tr("Load Session"), "open", tr("Load a session from file."), null, true, "load-session", true);
     52        super(true);
     53        setName(tr("Load Session"));
     54        setIcon("open");
     55        setTooltip(tr("Load a session from file."));
     56        registerInToolbar("load-session");
    5357        setHelpId(ht("/Action/SessionLoad"));
    5458    }
    5559
  • src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java b/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
    index a34a5aee2..f279284f7 100644
    a b public SessionSaveAsAction() {  
    7272     * @param installAdapters False, if you don't want to install layer changed and selection changed adapters
    7373     */
    7474    protected SessionSaveAsAction(boolean toolbar, boolean installAdapters) {
    75         super(tr("Save Session As..."), "session", tr("Save the current session to a new file."),
    76                 null, toolbar, "save_as-session", installAdapters);
     75        super(installAdapters);
     76        setName(tr("Save Session As..."));
     77        setIcon("session");
     78        if (toolbar) {
     79            registerInToolbar("save_as-session");
     80        }
     81        setTooltip(tr("Save the current session to a new file."));
    7782        setHelpId(ht("/Action/SessionSaveAs"));
    7883        MainApplication.addMapFrameListener(this);
    7984    }
  • src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java b/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
    index 4ae68d504..7c29bd4d4 100644
    a b  
    6161     * Constructs a new {@code ShowStatusReportAction}
    6262     */
    6363    public ShowStatusReportAction() {
    64         super(
    65                 tr("Show Status Report"),
    66                 "clock",
    67                 tr("Show status report with useful information that can be attached to bugs"),
    68                 Shortcut.registerShortcut("help:showstatusreport", tr("Help: {0}",
    69                         tr("Show Status Report")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true, "help/showstatusreport", false);
    70 
     64        super(false);
     65        setName(tr("Show Status Report"));
     66        setIcon("clock");
     67        setShortcut(Shortcut.registerShortcut("help:showstatusreport", tr("Help: {0}",
     68                tr("Show Status Report")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE));
     69        setTooltip(tr("Show status report with useful information that can be attached to bugs"));
     70        registerInToolbar("help/showstatusreport");
    7171        setHelpId(ht("/Action/ShowStatusReport"));
    7272    }
    7373
  • src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SimplifyWayAction.java b/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
    index ebf0eb28b..70fa84b30 100644
    a b  
    6161     * Constructs a new {@code SimplifyWayAction}.
    6262     */
    6363    public SimplifyWayAction() {
    64         super(tr("Simplify Way"), "simplify", tr("Delete unnecessary nodes from a way."),
    65                 Shortcut.registerShortcut("tools:simplify", tr("Tool: {0}", tr("Simplify Way")), KeyEvent.VK_Y, Shortcut.SHIFT), true);
     64        setName(tr("Simplify Way"));
     65        setIcon("simplify");
     66        setShortcut(Shortcut.registerShortcut("tools:simplify", tr("Tool: {0}", tr("Simplify Way")), KeyEvent.VK_Y, Shortcut.SHIFT));
     67        setTooltip(tr("Delete unnecessary nodes from a way."));
     68        registerInToolbar("simplify");
    6669        setHelpId(ht("/Action/SimplifyWay"));
    6770    }
    6871
  • src/org/openstreetmap/josm/actions/SplitWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/SplitWayAction.java b/src/org/openstreetmap/josm/actions/SplitWayAction.java
    index ee698e56e..b313cfb47 100644
    a b  
    5454     * Create a new SplitWayAction.
    5555     */
    5656    public SplitWayAction() {
    57         super(tr("Split Way"), "splitway", tr("Split a way at the selected node."),
    58                 Shortcut.registerShortcut("tools:splitway", tr("Tool: {0}", tr("Split Way")), KeyEvent.VK_P, Shortcut.DIRECT), true);
     57        setName(tr("Split Way"));
     58        setIcon("splitway");
     59        setShortcut(Shortcut.registerShortcut("tools:splitway", tr("Tool: {0}", tr("Split Way")), KeyEvent.VK_P, Shortcut.DIRECT));
     60        setTooltip(tr("Split a way at the selected node."));
     61        registerInToolbar("splitway");
    5962        setHelpId(ht("/Action/SplitWay"));
    6063    }
    6164
  • src/org/openstreetmap/josm/actions/TaggingPresetSearchAction.java

    diff --git a/src/org/openstreetmap/josm/actions/TaggingPresetSearchAction.java b/src/org/openstreetmap/josm/actions/TaggingPresetSearchAction.java
    index 0f7ea1d7c..a4bc51a8c 100644
    a b  
    66import java.awt.event.ActionEvent;
    77import java.awt.event.KeyEvent;
    88
    9 import org.openstreetmap.josm.gui.MainApplication;
    109import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchDialog;
    1110import org.openstreetmap.josm.tools.Shortcut;
    1211
     
    2120     * Constructs a new {@code TaggingPresetSearchAction}.
    2221     */
    2322    public TaggingPresetSearchAction() {
    24         super(tr("Search preset..."), "dialogs/search", tr("Show preset search dialog"),
    25                 Shortcut.registerShortcut("preset:search", tr("Search presets"), KeyEvent.VK_F3, Shortcut.DIRECT), false);
    26         setToolbarId("presets/search");
    27         MainApplication.getToolbar().register(this);
     23        setName(tr("Search preset..."));
     24        setIcon("dialogs/search");
     25        setShortcut(Shortcut.registerShortcut("preset:search", tr("Search presets"), KeyEvent.VK_F3, Shortcut.DIRECT));
     26        setTooltip(tr("Show preset search dialog"));
     27        setToolbarId("dialogs/search");
     28        registerInToolbar("presets/search");
    2829    }
    2930
    3031    @Override
  • src/org/openstreetmap/josm/actions/ToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ToggleAction.java b/src/org/openstreetmap/josm/actions/ToggleAction.java
    index 9c64775dd..d5065e7ab 100644
    a b  
    2424
    2525    private final transient Set<ButtonModel> buttonModels = new HashSet<>();
    2626
     27    /**
     28     * Constructs a {@code ToggleAction}.
     29     *
     30     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     31     */
     32    public ToggleAction(boolean installAdapters) {
     33        super(installAdapters);
     34        // It is required to set the SELECTED_KEY to a non-null value in order to let Swing components update it
     35        setSelected(false);
     36    }
     37
    2738    /**
    2839     * Constructs a {@code ToggleAction}.
    2940     *
     
    3849     * @param registerInToolbar register this action for the toolbar preferences?
    3950     * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    4051     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     52     * @deprecated use {@link JosmAction#JosmAction(boolean)} and setters
    4153     */
     54    @Deprecated
    4255    public ToggleAction(String name, ImageProvider icon, String tooltip, Shortcut shortcut, boolean registerInToolbar,
    4356            String toolbarId, boolean installAdapters) {
    4457        super(name, icon, tooltip, shortcut, registerInToolbar, toolbarId, installAdapters);
    public ToggleAction(String name, ImageProvider icon, String tooltip, Shortcut sh  
    5871     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    5972     *            the user CANNOT configure a shortcut for your action.
    6073     * @param registerInToolbar register this action for the toolbar preferences?
     74     * @deprecated use setters
    6175     */
     76    @Deprecated
    6277    public ToggleAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
    6378        super(name, iconName, tooltip, shortcut, registerInToolbar);
    6479        // It is required to set the SELECTED_KEY to a non-null value in order to let Swing components update it
  • src/org/openstreetmap/josm/actions/UnGlueAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UnGlueAction.java b/src/org/openstreetmap/josm/actions/UnGlueAction.java
    index 2aef02a45..6ef6bf06a 100644
    a b  
    5959     * Create a new UnGlueAction.
    6060     */
    6161    public UnGlueAction() {
    62         super(tr("UnGlue Ways"), "unglueways", tr("Duplicate nodes that are used by multiple ways."),
    63                 Shortcut.registerShortcut("tools:unglue", tr("Tool: {0}", tr("UnGlue Ways")), KeyEvent.VK_G, Shortcut.DIRECT), true);
     62        setName(tr("UnGlue Ways"));
     63        setIcon("unglueways");
     64        setShortcut(Shortcut.registerShortcut("tools:unglue", tr("Tool: {0}", tr("UnGlue Ways")), KeyEvent.VK_G, Shortcut.DIRECT));
     65        setTooltip(tr("Duplicate nodes that are used by multiple ways."));
     66        registerInToolbar("unglueways");
    6467        setHelpId(ht("/Action/UnGlue"));
    6568    }
    6669
  • src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java b/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
    index 073b09e1f..4a284b53b 100644
    a b  
    3535     * Constructs a new {@code UnJoinNodeWayAction}.
    3636     */
    3737    public UnJoinNodeWayAction() {
    38         super(tr("Disconnect Node from Way"), "unjoinnodeway",
    39                 tr("Disconnect nodes from a way they currently belong to"),
    40                 Shortcut.registerShortcut("tools:unjoinnodeway",
    41                     tr("Tool: {0}", tr("Disconnect Node from Way")), KeyEvent.VK_J, Shortcut.ALT), true);
     38        setName(tr("Disconnect Node from Way"));
     39        setIcon("unjoinnodeway");
     40        setShortcut(Shortcut.registerShortcut("tools:unjoinnodeway", tr("Tool: {0}", tr("Disconnect Node from Way")),
     41                KeyEvent.VK_J, Shortcut.ALT));
     42        setTooltip(tr("Disconnect nodes from a way they currently belong to"));
     43        registerInToolbar("unjoinnodeway");
    4244        setHelpId(ht("/Action/UnJoinNodeWay"));
    4345    }
    4446
  • src/org/openstreetmap/josm/actions/UndoAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UndoAction.java b/src/org/openstreetmap/josm/actions/UndoAction.java
    index 751d16e28..6ce1c3169 100644
    a b  
    2424     * Construct the action with "Undo" as label.
    2525     */
    2626    public UndoAction() {
    27         super(tr("Undo"), "undo", tr("Undo the last action."),
    28                 Shortcut.registerShortcut("system:undo", tr("Edit: {0}", tr("Undo")), KeyEvent.VK_Z, Shortcut.CTRL), true);
     27        setName(tr("Undo"));
     28        setIcon("undo");
     29        setShortcut(Shortcut.registerShortcut("system:undo", tr("Edit: {0}", tr("Undo")), KeyEvent.VK_Z, Shortcut.CTRL));
     30        setTooltip(tr("Undo the last action."));
     31        registerInToolbar("undo");
    2932        setEnabled(false);
    3033        setHelpId(ht("/Action/Undo"));
    3134    }
  • src/org/openstreetmap/josm/actions/UnselectAllAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UnselectAllAction.java b/src/org/openstreetmap/josm/actions/UnselectAllAction.java
    index 8f8d37357..06015f9d3 100644
    a b  
    1818     * Constructs a new {@code UnselectAllAction}.
    1919     */
    2020    public UnselectAllAction() {
    21         super(tr("Unselect All"), "unselectall", tr("Unselect all objects."),
    22             Shortcut.registerShortcut("edit:unselectall", tr("Edit: {0}",
    23             tr("Unselect All")), KeyEvent.VK_ESCAPE, Shortcut.DIRECT), true);
    24 
     21        setName(tr("Unselect All"));
     22        setIcon("unselectall");
     23        setShortcut(Shortcut.registerShortcut("edit:unselectall", tr("Edit: {0}", tr("Unselect All")), KeyEvent.VK_ESCAPE, Shortcut.DIRECT));
     24        setTooltip(tr("Unselect all objects."));
     25        registerInToolbar("unselectall");
    2526        setHelpId(ht("/Action/UnselectAll"));
    2627    }
    2728
  • src/org/openstreetmap/josm/actions/UpdateDataAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UpdateDataAction.java b/src/org/openstreetmap/josm/actions/UpdateDataAction.java
    index d4a37f99a..f77c0d7ad 100644
    a b  
    3131     * Constructs a new {@code UpdateDataAction}.
    3232     */
    3333    public UpdateDataAction() {
    34         super(tr("Update data"),
    35                 "updatedata",
    36                 tr("Updates the objects in the active data layer from the server."),
    37                 Shortcut.registerShortcut("file:updatedata",
    38                         tr("File: {0}", tr("Update data")),
    39                         KeyEvent.VK_U, Shortcut.CTRL),
    40                 true);
     34        setName(tr("Update data"));
     35        setIcon("updatedata");
     36        setShortcut(Shortcut.registerShortcut("file:updatedata", tr("File: {0}", tr("Update data")), KeyEvent.VK_U, Shortcut.CTRL));
     37        setTooltip(tr("Updates the objects in the active data layer from the server."));
     38        registerInToolbar("updatedata");
    4139        setHelpId(ht("/Action/UpdateData"));
    4240    }
    4341
  • src/org/openstreetmap/josm/actions/UpdateModifiedAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java b/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java
    index 59b257612..b8640670c 100644
    a b  
    2525     * Constructs a new {@code UpdateModifiedAction}.
    2626     */
    2727    public UpdateModifiedAction() {
    28         super(tr("Update modified"), "updatedata",
    29                 tr("Updates the currently modified objects from the server (re-downloads data)"),
    30                 Shortcut.registerShortcut("file:updatemodified",
    31                         tr("File: {0}", tr("Update modified")), KeyEvent.VK_M,
    32                         Shortcut.ALT_CTRL),
    33                         true, "updatemodified");
     28        super(false);
     29        setName(tr("Update modified"));
     30        setIcon("updatedata");
     31        setShortcut(Shortcut.registerShortcut("file:updatemodified",
     32                tr("File: {0}", tr("Update modified")), KeyEvent.VK_M, Shortcut.ALT_CTRL));
     33        setTooltip(tr("Updates the currently modified objects from the server (re-downloads data)"));
     34        registerInToolbar("updatemodified");
    3435        setHelpId(ht("/Action/UpdateModified"));
    3536    }
    3637
  • src/org/openstreetmap/josm/actions/UpdateSelectionAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java b/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
    index a692dcf2f..11694e982 100644
    a b public static void updatePrimitive(PrimitiveId id) {  
    8585     * Constructs a new {@code UpdateSelectionAction}.
    8686     */
    8787    public UpdateSelectionAction() {
    88         super(tr("Update selection"), "updatedata",
    89                 tr("Updates the currently selected objects from the server (re-downloads data)"),
    90                 Shortcut.registerShortcut("file:updateselection",
    91                         tr("File: {0}", tr("Update selection")), KeyEvent.VK_U,
    92                         Shortcut.ALT_CTRL),
    93                 true, "updateselection", true);
     88        setName(tr("Update selection"));
     89        setIcon("updatedata");
     90        setShortcut(Shortcut.registerShortcut("file:updateselection",
     91                tr("File: {0}", tr("Update selection")), KeyEvent.VK_U, Shortcut.ALT_CTRL));
     92        setTooltip(tr("Updates the currently selected objects from the server (re-downloads data)"));
     93        registerInToolbar("updateselection");
    9494        setHelpId(ht("/Action/UpdateSelection"));
    9595    }
    9696
    97     /**
    98      * Constructs a new {@code UpdateSelectionAction}.
    99      *
    100      * @param name the action's text as displayed on the menu (if it is added to a menu)
    101      * @param iconName the filename of the icon to use
    102      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    103      *           that html is not supported for menu actions on some platforms.
    104      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    105      *            do want a shortcut, remember you can always register it with group=none, so you
    106      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    107      *            the user CANNOT configure a shortcut for your action.
    108      * @param register register this action for the toolbar preferences?
    109      * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    110      */
    111     public UpdateSelectionAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, String toolbarId) {
    112         super(name, iconName, tooltip, shortcut, register, toolbarId, true);
     97    protected UpdateSelectionAction(boolean installAdapters) {
     98        super(installAdapters);
    11399    }
    114100
    115101    @Override
  • src/org/openstreetmap/josm/actions/UploadAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UploadAction.java b/src/org/openstreetmap/josm/actions/UploadAction.java
    index 406d40572..beae81a7c 100644
    a b public static void unregisterUploadHook(UploadHook hook) {  
    140140     * Constructs a new {@code UploadAction}.
    141141     */
    142142    public UploadAction() {
    143         super(tr("Upload data..."), "upload", tr("Upload all changes in the active data layer to the OSM server"),
    144                 Shortcut.registerShortcut("file:upload", tr("File: {0}", tr("Upload data")), KeyEvent.VK_UP, Shortcut.CTRL_SHIFT), true);
     143        setName(tr("Upload data..."));
     144        setIcon("upload");
     145        setShortcut(Shortcut.registerShortcut("file:upload", tr("File: {0}", tr("Upload data")), KeyEvent.VK_UP, Shortcut.CTRL_SHIFT));
     146        setTooltip(tr("Upload all changes in the active data layer to the OSM server"));
     147        registerInToolbar("upload");
    145148        setHelpId(ht("/Action/Upload"));
    146149    }
    147150
  • src/org/openstreetmap/josm/actions/UploadSelectionAction.java

    diff --git a/src/org/openstreetmap/josm/actions/UploadSelectionAction.java b/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
    index f93942a6c..eab0594c6 100644
    a b  
    4444     * Constructs a new {@code UploadSelectionAction}.
    4545     */
    4646    public UploadSelectionAction() {
    47         super(
    48                 tr("Upload selection..."),
    49                 "uploadselection",
    50                 tr("Upload all changes in the current selection to the OSM server."),
    51                 // CHECKSTYLE.OFF: LineLength
    52                 Shortcut.registerShortcut("file:uploadSelection", tr("File: {0}", tr("Upload selection")), KeyEvent.VK_U, Shortcut.ALT_CTRL_SHIFT),
    53                 // CHECKSTYLE.ON: LineLength
    54                 true);
     47        setName(tr("Upload selection..."));
     48        setIcon("uploadselection");
     49        setShortcut(Shortcut.registerShortcut("file:uploadSelection", tr("File: {0}", tr("Upload selection")),
     50                KeyEvent.VK_U, Shortcut.ALT_CTRL_SHIFT));
     51        setTooltip(tr("Upload all changes in the current selection to the OSM server."));
     52        registerInToolbar("uploadselection");
    5553        setHelpId(ht("/Action/UploadSelection"));
    5654    }
    5755
  • src/org/openstreetmap/josm/actions/ValidateAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ValidateAction.java b/src/org/openstreetmap/josm/actions/ValidateAction.java
    index c2e1f4337..833fc2fc1 100644
    a b  
    4343     * Constructor
    4444     */
    4545    public ValidateAction() {
    46         super(tr("Validation"), "dialogs/validator", tr("Performs the data validation"),
    47                 Shortcut.registerShortcut("tools:validate", tr("Tool: {0}", tr("Validation")),
    48                         KeyEvent.VK_V, Shortcut.SHIFT), true);
     46        setName(tr("Validation"));
     47        setIcon("dialogs/validator");
     48        setShortcut(Shortcut.registerShortcut("tools:validate", tr("Tool: {0}", tr("Validation")), KeyEvent.VK_V, Shortcut.SHIFT));
     49        setTooltip(tr("Performs the data validation"));
     50        registerInToolbar("dialogs/validator");
    4951    }
    5052
    5153    @Override
  • src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java b/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
    index 5d42d6dc1..22fe7deab 100644
    a b  
    2828     * Constructs a new {@code ViewportFollowToggleAction}.
    2929     */
    3030    public ViewportFollowToggleAction() {
    31         super(tr("Viewport Following"),
    32               "viewport-follow",
    33               tr("Enable/disable automatic moving of the map view to last placed node"),
    34               Shortcut.registerShortcut("menu:view:viewportfollow", tr("Toggle Viewport Following"),
    35               KeyEvent.VK_F, Shortcut.CTRL_SHIFT),
    36               true /* register shortcut */
    37         );
     31        super(true);
     32        setName(tr("Viewport Following"));
     33        setIcon("viewport-follow");
     34        setShortcut(Shortcut.registerShortcut("menu:view:viewportfollow", tr("Toggle Viewport Following"),
     35                KeyEvent.VK_F, Shortcut.CTRL_SHIFT));
     36        setTooltip(tr("Enable/disable automatic moving of the map view to last placed node"));
     37        registerInToolbar("viewport-follow");
    3838        setHelpId(ht("/Action/ViewportFollowing"));
    3939        setSelected(DrawAction.VIEWPORT_FOLLOWING.get());
    4040        notifySelectedState();
  • src/org/openstreetmap/josm/actions/WireframeToggleAction.java

    diff --git a/src/org/openstreetmap/josm/actions/WireframeToggleAction.java b/src/org/openstreetmap/josm/actions/WireframeToggleAction.java
    index a4a17917e..5b3ab932f 100644
    a b  
    99import org.openstreetmap.josm.data.osm.visitor.paint.MapRendererFactory;
    1010import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
    1111import org.openstreetmap.josm.data.osm.visitor.paint.WireframeMapRenderer;
    12 import org.openstreetmap.josm.gui.MainApplication;
    1312import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1413import org.openstreetmap.josm.tools.Shortcut;
    1514
     
    2322     * Constructs a new {@code WireframeToggleAction}.
    2423     */
    2524    public WireframeToggleAction() {
    26         super(tr("Wireframe View"),
    27               null, /* no icon */
    28               tr("Enable/disable rendering the map as wireframe only"),
    29               Shortcut.registerShortcut("menu:view:wireframe", tr("Toggle Wireframe view"), KeyEvent.VK_W, Shortcut.CTRL),
    30               false /* register toolbar */
    31         );
    32         setToolbarId("wireframe");
    33         MainApplication.getToolbar().register(this);
     25        super(true);
     26        setName(tr("Wireframe View"));
     27        setShortcut(Shortcut.registerShortcut("menu:view:wireframe", tr("Toggle Wireframe view"), KeyEvent.VK_W, Shortcut.CTRL));
     28        setTooltip(tr("Enable/disable rendering the map as wireframe only"));
     29        registerInToolbar("wireframe");
    3430        setSelected(MapRendererFactory.getInstance().isWireframeMapRendererActive());
    3531        notifySelectedState();
    3632    }
  • src/org/openstreetmap/josm/actions/ZoomInAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ZoomInAction.java b/src/org/openstreetmap/josm/actions/ZoomInAction.java
    index 18a1a70e3..f733683ab 100644
    a b  
    2020     * Constructs a new {@code ZoomInAction}.
    2121     */
    2222    public ZoomInAction() {
    23         super(
    24                 tr("Zoom In"),
    25                 "dialogs/zoomin",
    26                 tr("Zoom In"),
    27                 // Although it might be possible on few custom keyboards, the vast majority of layouts do not have a direct '+' key, see below
    28                 Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")), KeyEvent.VK_PLUS, Shortcut.DIRECT),
    29                 true
    30         );
     23        setName(tr("Zoom In"));
     24        setIcon("dialogs/zoomin");
     25        // Although it might be possible on few custom keyboards, the vast majority of layouts do not have a direct '+' key, see below
     26        setShortcut(Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")), KeyEvent.VK_PLUS, Shortcut.DIRECT));
     27        setTooltip(tr("Zoom In"));
     28        registerInToolbar("dialogs/zoomin");
    3129        setHelpId(ht("/Action/ZoomIn"));
    3230        // On standard QWERTY, AZERTY and other common layouts the '+' key is obtained with Shift+EQUALS
    3331        MainApplication.registerActionShortcut(this,
  • src/org/openstreetmap/josm/actions/ZoomOutAction.java

    diff --git a/src/org/openstreetmap/josm/actions/ZoomOutAction.java b/src/org/openstreetmap/josm/actions/ZoomOutAction.java
    index d4c4ff1b9..9c9e5c1bd 100644
    a b  
    2020     * Constructs a new {@code ZoomOutAction}.
    2121     */
    2222    public ZoomOutAction() {
    23         super(tr("Zoom Out"), "dialogs/zoomout", tr("Zoom Out"),
    24                 Shortcut.registerShortcut("view:zoomout", tr("View: {0}", tr("Zoom Out")), KeyEvent.VK_MINUS, Shortcut.DIRECT), true);
     23        setName(tr("Zoom Out"));
     24        setIcon("dialogs/zoomout");
     25        setShortcut(Shortcut.registerShortcut("view:zoomout", tr("View: {0}", tr("Zoom Out")), KeyEvent.VK_MINUS, Shortcut.DIRECT));
     26        setTooltip(tr("Zoom Out"));
     27        registerInToolbar("dialogs/zoomout");
    2528        setHelpId(ht("/Action/ZoomOut"));
    2629        // make numpad - behave like -
    2730        MainApplication.registerActionShortcut(this,
  • src/org/openstreetmap/josm/actions/audio/AbstractAudioAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AbstractAudioAction.java b/src/org/openstreetmap/josm/actions/audio/AbstractAudioAction.java
    index 315916618..6b67fb376 100644
    a b  
    55import org.openstreetmap.josm.gui.MainApplication;
    66import org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker;
    77import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    8 import org.openstreetmap.josm.tools.Shortcut;
    98
    109/**
    1110 * Base class for every action related to audio content.
     
    1514
    1615    /**
    1716     * Constructs a new {@code BaseAudioAction}.
    18      * @param name the action's text as displayed on the menu (if it is added to a menu)
    19      * @param iconName the filename of the icon to use
    20      * @param tooltip a longer description of the action that will be displayed in the tooltip
    21      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut
    22      * @param registerInToolbar register this action for the toolbar preferences?
    2317     */
    24     public AbstractAudioAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
    25         super(name, iconName, tooltip, shortcut, registerInToolbar);
     18    public AbstractAudioAction() {
    2619        updateEnabledState();
    2720    }
    2821
  • src/org/openstreetmap/josm/actions/audio/AudioBackAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java b/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java
    index 6d609773a..ad3e6ac54 100644
    a b  
    2525     * Constructs a new {@code AudioBackAction}.
    2626     */
    2727    public AudioBackAction() {
    28         super(trc("audio", "Back"), "audio-back", trc("audio", "Jump back."),
    29         Shortcut.registerShortcut("audio:back", tr("Audio: {0}", trc("audio", "Back")), KeyEvent.VK_F6, Shortcut.DIRECT), true);
     28        setName(trc("audio", "Back"));
     29        setIcon("audio-back");
     30        setShortcut(Shortcut.registerShortcut("audio:back", tr("Audio: {0}", trc("audio", "Back")), KeyEvent.VK_F6, Shortcut.DIRECT));
     31        setTooltip(trc("audio", "Jump back."));
     32        registerInToolbar("audio-back");
    3033        setHelpId(ht("/Action/AudioBack"));
    3134    }
    3235
  • src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java b/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java
    index ab83c8000..f75ebe222 100644
    a b  
    77import org.openstreetmap.josm.io.audio.AudioPlayer;
    88import org.openstreetmap.josm.io.audio.AudioUtil;
    99import org.openstreetmap.josm.spi.preferences.Config;
    10 import org.openstreetmap.josm.tools.Shortcut;
    1110
    1211/**
    1312 * Abstract superclass of {@link AudioFasterAction} and {@link AudioSlowerAction}.
     
    2019    /**
    2120     * Constructs a new {@code AudioFastSlowAction}.
    2221     *
    23      * @param name the action's text as displayed on the menu (if it is added to a menu)
    24      * @param iconName the filename of the icon to use
    25      * @param tooltip  a longer description of the action that will be displayed in the tooltip.
    26      * @param shortcut a ready-created shortcut object.
    2722     * @param fast {@code true} to increase speed (faster audio), {@code false} to decrease it (slower audio).
    2823     */
    29     public AudioFastSlowAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean fast) {
    30         super(name, iconName, tooltip, shortcut, true);
     24    public AudioFastSlowAction(boolean fast) {
    3125        multiplier = Config.getPref().getDouble("audio.fastfwdmultiplier", 1.3);
    3226        if (!fast)
    3327            multiplier = 1.0 / multiplier;
  • src/org/openstreetmap/josm/actions/audio/AudioFasterAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioFasterAction.java b/src/org/openstreetmap/josm/actions/audio/AudioFasterAction.java
    index 0eca15e99..125a556aa 100644
    a b  
    2020     * Constructs a new {@code AudioFasterAction}.
    2121     */
    2222    public AudioFasterAction() {
    23         super(trc("audio", "Faster"), "audio-faster", trc("audio", "Faster Forward"),
    24         Shortcut.registerShortcut("audio:faster", tr("Audio: {0}", trc("audio", "Faster")), KeyEvent.VK_F9, Shortcut.DIRECT), true);
     23        super(true);
     24        setName(trc("audio", "Faster"));
     25        setIcon("audio-faster");
     26        setShortcut(Shortcut.registerShortcut("audio:faster", tr("Audio: {0}", trc("audio", "Faster")), KeyEvent.VK_F9, Shortcut.DIRECT));
     27        setTooltip(trc("audio", "Faster Forward"));
    2528        setHelpId(ht("/Action/AudioFaster"));
    2629    }
    2730}
  • src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java b/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java
    index 0eed041a5..520f979fc 100644
    a b  
    2424     * Constructs a new {@code AudioFwdAction}.
    2525     */
    2626    public AudioFwdAction() {
    27         super(trc("audio", "Forward"), "audio-fwd", trc("audio", "Jump forward"),
    28         Shortcut.registerShortcut("audio:forward", tr("Audio: {0}", trc("audio", "Forward")), KeyEvent.VK_F7, Shortcut.DIRECT), true);
     27        setName(trc("audio", "Forward"));
     28        setIcon("audio-fwd");
     29        setShortcut(Shortcut.registerShortcut("audio:forward", tr("Audio: {0}", trc("audio", "Forward")), KeyEvent.VK_F7, Shortcut.DIRECT));
     30        setTooltip(trc("audio", "Jump forward"));
     31        registerInToolbar("audio-fwd");
    2932    }
    3033
    3134    @Override
  • src/org/openstreetmap/josm/actions/audio/AudioNextAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioNextAction.java b/src/org/openstreetmap/josm/actions/audio/AudioNextAction.java
    index 5fbc41162..2661b83b8 100644
    a b  
    2121     * Constructs a new {@code AudioNextAction}.
    2222     */
    2323    public AudioNextAction() {
    24         super(trc("audio", "Next Marker"), "audio-next", trc("audio", "Play next marker."),
    25         Shortcut.registerShortcut("audio:next", tr("Audio: {0}", trc("audio", "Next Marker")), KeyEvent.VK_F8, Shortcut.DIRECT), true);
     24        setName(trc("audio", "Next Marker"));
     25        setIcon("audio-next");
     26        setShortcut(Shortcut.registerShortcut("audio:next", tr("Audio: {0}", trc("audio", "Next Marker")), KeyEvent.VK_F8, Shortcut.DIRECT));
     27        setTooltip(trc("audio", "Play next marker."));
     28        registerInToolbar("audio-next");
    2629    }
    2730
    2831    @Override
  • src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java b/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java
    index b9ed619cb..1774c2b1c 100644
    a b  
    2828     * Constructs a new {@code AudioPlayPauseAction}.
    2929     */
    3030    public AudioPlayPauseAction() {
    31         super(trc("audio", "Play/Pause"), "audio-playpause", tr("Play/pause audio."),
    32         Shortcut.registerShortcut("audio:pause", tr("Audio: {0}", trc("audio", "Play/Pause")), KeyEvent.VK_PERIOD, Shortcut.DIRECT), true);
     31        setName(trc("audio", "Play/Pause"));
     32        setIcon("audio-playpause");
     33        setShortcut(Shortcut.registerShortcut("audio:pause", tr("Audio: {0}", trc("audio", "Play/Pause")),
     34                KeyEvent.VK_PERIOD, Shortcut.DIRECT));
     35        setTooltip(tr("Play/pause audio."));
     36        registerInToolbar("audio-playpause");
    3337    }
    3438
    3539    @Override
  • src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java b/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java
    index 9ac8040ec..c4a7a15a8 100644
    a b  
    2121     * Constructs a new {@code AudioPrevAction}.
    2222     */
    2323    public AudioPrevAction() {
    24         super(trc("audio", "Previous Marker"), "audio-prev", trc("audio", "Play previous marker."),
    25         Shortcut.registerShortcut("audio:prev", tr("Audio: {0}", trc("audio", "Previous Marker")), KeyEvent.VK_F5, Shortcut.DIRECT), true);
     24        setName(trc("audio", "Previous Marker"));
     25        setIcon("audio-prev");
     26        setShortcut(Shortcut.registerShortcut("audio:prev", tr("Audio: {0}", trc("audio", "Previous Marker")),
     27                KeyEvent.VK_F5, Shortcut.DIRECT));
     28        setTooltip(trc("audio", "Play previous marker."));
     29        registerInToolbar("audio-prev");
    2630    }
    2731
    2832    @Override
  • src/org/openstreetmap/josm/actions/audio/AudioSlowerAction.java

    diff --git a/src/org/openstreetmap/josm/actions/audio/AudioSlowerAction.java b/src/org/openstreetmap/josm/actions/audio/AudioSlowerAction.java
    index 300a944af..738416785 100644
    a b  
    2020     * Constructs a new {@code AudioSlowerAction}.
    2121     */
    2222    public AudioSlowerAction() {
    23         super(trc("audio", "Slower"), "audio-slower", trc("audio", "Slower Forward"),
    24         Shortcut.registerShortcut("audio:slower", tr("Audio: {0}", trc("audio", "Slower")), KeyEvent.VK_F4, Shortcut.DIRECT), false);
     23        super(false);
     24        setName(trc("audio", "Slower"));
     25        setIcon("audio-slower");
     26        setShortcut(Shortcut.registerShortcut("audio:slower", tr("Audio: {0}", trc("audio", "Slower")), KeyEvent.VK_F4, Shortcut.DIRECT));
     27        setTooltip(trc("audio", "Slower Forward"));
    2528        setHelpId(ht("/Action/AudioSlower"));
    2629    }
    2730}
  • src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    diff --git a/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java b/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
    index b436c5f3b..974530a59 100644
    a b public void actionPerformed(ActionEvent e) {  
    13961396         * Constructs a new {@code SnapChangeAction}.
    13971397         */
    13981398        SnapChangeAction() {
    1399             super(tr("Angle snapping"), /* ICON() */ "anglesnap",
    1400                     tr("Switch angle snapping mode while drawing"), null, false);
     1399            setName(tr("Angle snapping"));
     1400            setIcon(/* ICON() */ "anglesnap");
     1401            setTooltip(tr("Switch angle snapping mode while drawing"));
     1402            setToolbarId("anglesnap");
    14011403            setHelpId(ht("/Action/Draw/AngleSnap"));
    14021404        }
    14031405
  • src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java b/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
    index 030937e86..261dd10f9 100644
    a b public String toString() {  
    195195
    196196    private class DualAlignChangeAction extends JosmAction {
    197197        DualAlignChangeAction() {
    198             super(tr("Dual alignment"), /* ICON() */ "mapmode/extrude/dualalign",
    199                     tr("Switch dual alignment mode while extruding"), null, false);
     198            setName(tr("Dual alignment"));
     199            setIcon(/* ICON() */ "mapmode/extrude/dualalign");
     200            setTooltip(tr("Switch dual alignment mode while extruding"));
     201            setToolbarId("mapmode/extrude/dualalign");
    200202            setHelpId(ht("/Action/Extrude#DualAlign"));
    201203        }
    202204
  • src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    diff --git a/src/org/openstreetmap/josm/actions/mapmode/MapMode.java b/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
    index ad825161e..23fd31d18 100644
    a b  
    4444     * @since 11713
    4545     */
    4646    public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, Cursor cursor) {
    47         super(name, "mapmode/"+iconName, tooltip, shortcut, false);
     47        setName(name);
     48        setIcon("mapmode/" + iconName);
     49        setShortcut(shortcut);
     50        setTooltip(tooltip);
     51        setToolbarId("mapmode/" + iconName);
    4852        this.cursor = cursor;
    4953        putValue("active", Boolean.FALSE);
    5054    }
    public MapMode(String name, String iconName, String tooltip, Shortcut shortcut,  
    5862     * @since 11713
    5963     */
    6064    public MapMode(String name, String iconName, String tooltip, Cursor cursor) {
    61         putValue(NAME, name);
     65        setName(name);
     66        setTooltip(tooltip);
    6267        new ImageProvider("mapmode", iconName).getResource().attachImageIcon(this);
    63         putValue(SHORT_DESCRIPTION, tooltip);
    6468        this.cursor = cursor;
    6569    }
    6670
  • src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java

    diff --git a/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java b/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java
    index 0831df871..8e9eded2c 100644
    a b public ExportRelationToGpxAction() {  
    7777     * @param mode which mode to use, see {@code ExportRelationToGpxAction.Mode}
    7878     */
    7979    public ExportRelationToGpxAction(Set<Mode> mode) {
    80         super(name(mode), mode.contains(TO_FILE) ? "exportgpx" : "dialogs/layerlist", tooltip(mode),
    81                 null, false, null, false);
     80        super(false);
     81        setName(name(mode));
     82        setIcon(mode.contains(TO_FILE) ? "exportgpx" : "dialogs/layerlist");
     83        setTooltip(tooltip(mode));
    8284        setHelpId(ht("/Action/ExportRelationToGpx"));
    8385        this.mode = mode;
    8486    }
  • src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java

    diff --git a/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java b/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
    index f9cefcf21..e067bf68b 100644
    a b  
    4545     * @param editButton edit button
    4646     */
    4747    public RecentRelationsAction(SideButton editButton) {
    48         super(RecentRelationsAction.class.getName(), null, null, null, false, true);
     48        setName(RecentRelationsAction.class.getName());
    4949        this.editButton = editButton;
    5050        arrow = editButton.createArrow(this);
    5151        arrow.setToolTipText(tr("List of recent relations"));
  • src/org/openstreetmap/josm/actions/search/SearchAction.java

    diff --git a/src/org/openstreetmap/josm/actions/search/SearchAction.java b/src/org/openstreetmap/josm/actions/search/SearchAction.java
    index f634ded70..d72b8e1c4 100644
    a b public static void saveToHistory(SearchSetting s) {  
    142142     * Constructs a new {@code SearchAction}.
    143143     */
    144144    public SearchAction() {
    145         super(tr("Search..."), "dialogs/search", tr("Search for objects"),
    146                 Shortcut.registerShortcut("system:find", tr("Search..."), KeyEvent.VK_F, Shortcut.CTRL), true);
     145        setName(tr("Search..."));
     146        setIcon("dialogs/search");
     147        setShortcut(Shortcut.registerShortcut("system:find", tr("Search..."), KeyEvent.VK_F, Shortcut.CTRL));
     148        setTooltip(tr("Search for objects"));
     149        registerInToolbar("dialogs/search");
    147150        setHelpId(ht("/Action/Search"));
    148151    }
    149152
  • src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java

    diff --git a/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java b/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
    index cc29b0aab..e67169453 100644
    a b private static JButton createHelpButton(String helpTopic) {  
    203203        private final String helpTopic;
    204204
    205205        HelpAction(String helpTopic) {
    206             super(tr("Help"), "help", tr("Show help information"), null, false, false);
     206            super(false);
     207            setName(tr("Help"));
     208            setIcon("help");
     209            setTooltip(tr("Show help information"));
     210            setToolbarId("help");
    207211            this.helpTopic = helpTopic;
    208212        }
    209213
  • src/org/openstreetmap/josm/gui/ImageryMenu.java

    diff --git a/src/org/openstreetmap/josm/gui/ImageryMenu.java b/src/org/openstreetmap/josm/gui/ImageryMenu.java
    index a192edafe..e1bc0ad57 100644
    a b  
    5454    static final class AdjustImageryOffsetAction extends JosmAction {
    5555
    5656        AdjustImageryOffsetAction() {
    57             super(tr("Imagery offset"), "mapmode/adjustimg", tr("Adjust imagery offset"), null, false, false);
    58             setToolbarId("imagery-offset");
    59             MainApplication.getToolbar().register(this);
     57            super(false);
     58            setName(tr("Imagery offset"));
     59            setIcon("mapmode/adjustimg");
     60            setTooltip(tr("Adjust imagery offset"));
     61            setToolbarId("mapmode/adjustimg");
     62            registerInToolbar("imagery-offset");
    6063        }
    6164
    6265        @Override
  • src/org/openstreetmap/josm/gui/autofilter/AutoFilterButton.java

    diff --git a/src/org/openstreetmap/josm/gui/autofilter/AutoFilterButton.java b/src/org/openstreetmap/josm/gui/autofilter/AutoFilterButton.java
    index 5c78e16fb..8ec84d5af 100644
    a b  
    2727
    2828    private final AutoFilter filter;
    2929
     30    private static class Action extends JosmAction {
     31        private final AutoFilter filter;
     32
     33        Action(AutoFilter filter) {
     34            this.filter = filter;
     35            setName(filter.getLabel());
     36            setTooltip(filter.getDescription());
     37        }
     38
     39        @Override
     40        public synchronized void actionPerformed(ActionEvent e) {
     41            AutoFilterManager afm = AutoFilterManager.getInstance();
     42            if (filter.equals(afm.getCurrentAutoFilter())) {
     43                afm.setCurrentAutoFilter(null);
     44                MainApplication.getMap().filterDialog.getFilterModel().executeFilters(true);
     45            } else {
     46                afm.setCurrentAutoFilter(filter);
     47            }
     48        }
     49    }
     50
    3051    /**
    3152     * Constructs a new {@code AutoFilterButton}.
    3253     * @param filter auto filter associated to this button
    3354     */
    3455    public AutoFilterButton(final AutoFilter filter) {
    35         super(new JosmAction(filter.getLabel(), null, filter.getDescription(), null, false) {
    36             @Override
    37             public synchronized void actionPerformed(ActionEvent e) {
    38                 AutoFilterManager afm = AutoFilterManager.getInstance();
    39                 if (filter.equals(afm.getCurrentAutoFilter())) {
    40                     afm.setCurrentAutoFilter(null);
    41                     MainApplication.getMap().filterDialog.getFilterModel().executeFilters(true);
    42                 } else {
    43                     afm.setCurrentAutoFilter(filter);
    44                 }
    45             }
    46         });
     56        super(new Action(filter));
    4757        this.filter = filter;
    4858        setForeground(Color.WHITE);
    4959        setContentAreaFilled(false);
  • src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java b/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java
    index 02e96d069..6adcca07b 100644
    a b public Component getListCellRendererComponent(JList<? extends JMenuItem> list, J  
    131131         * Constructs a new {@code Action}.
    132132         */
    133133        public Action() {
    134             super(tr("Search menu items"), "dialogs/search", null,
    135                     SHORTCUT,
    136                     true, "dialogs/search-items", false);
     134            super(false);
     135            setName(tr("Search menu items"));
     136            setIcon("dialogs/search");
     137            setShortcut(SHORTCUT);
     138            registerInToolbar("dialogs/search-items");
    137139            setHelpId(ht("Action/SearchMenuItems"));
    138140        }
    139141
  • src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java b/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
    index e2b8636a2..e3ec03cb7 100644
    a b protected void registerInWindowMenu(boolean isExpert) {  
    300300    public final class ToggleDialogAction extends JosmAction {
    301301
    302302        private ToggleDialogAction(String name, String iconName, String tooltip, Shortcut shortcut, String helpId) {
    303             super(name, iconName, tooltip, shortcut, false, false);
     303            super(false);
     304            setName(name);
     305            setIcon(iconName);
     306            setShortcut(shortcut);
     307            setTooltip(tooltip);
    304308            setHelpId(helpId);
    305309        }
    306310
  • src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java b/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
    index 00347787f..bd493e2d7 100644
    a b public void valueChanged(ListSelectionEvent e) {  
    204204
    205205        ShowUserInfoAction() {
    206206            super(false);
    207             putValue(NAME, tr("Show info"));
    208             putValue(SHORT_DESCRIPTION, tr("Launches a browser with information about the user"));
    209             new ImageProvider("help/internet").getResource().attachImageIcon(this, true);
     207            setName(tr("Show info"));
     208            setTooltip(tr("Launches a browser with information about the user"));
     209            setIcon("help/internet");
    210210            updateEnabledState();
    211211        }
    212212
  • src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java b/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
    index 044698997..63bc88f3d 100644
    a b public ValidatorDialog() {  
    123123        addTreeSelectionListener(new SelectionWatch());
    124124        InputMapUtils.unassignCtrlShiftUpDown(tree, JComponent.WHEN_FOCUSED);
    125125
    126         ignoreForNowAction = new JosmAction(tr("Ignore for now"), "dialogs/delete",
    127                 tr("Ignore and remove from tree."), Shortcut.registerShortcut("tools:validate:ignore-for-now",
    128                         tr("Ignore and remove from tree."), KeyEvent.VK_MINUS, Shortcut.SHIFT),
    129                 false, false) {
    130 
    131             @Override
    132             public void actionPerformed(ActionEvent e) {
    133                 TestError error = getSelectedError();
    134                 if (error != null) {
    135                     error.setIgnored(true);
    136                     tree.resetErrors();
    137                     invalidateValidatorLayers();
    138                 }
    139             }
    140         };
     126        ignoreForNowAction = new IgnoreForNowAction();
    141127
    142128        popupMenuHandler.addAction(MainApplication.getMenu().autoScaleActions.get("problem"));
    143129        popupMenuHandler.addAction(new EditRelationAction());
    public void destroy() {  
    730716            ignoreForNowAction.destroy();
    731717        }
    732718    }
     719
     720    private class IgnoreForNowAction extends JosmAction {
     721
     722        IgnoreForNowAction() {
     723            super(false);
     724            setName(tr("Ignore for now"));
     725            setIcon("dialogs/delete");
     726            setShortcut(Shortcut.registerShortcut("tools:validate:ignore-for-now", tr("Ignore and remove from tree."),
     727                    KeyEvent.VK_MINUS, Shortcut.SHIFT));
     728            setTooltip(tr("Ignore and remove from tree."));
     729            setToolbarId("dialogs/delete");
     730        }
     731
     732        @Override
     733        public void actionPerformed(ActionEvent e) {
     734            TestError error = getSelectedError();
     735            if (error != null) {
     736                error.setIgnored(true);
     737                tree.resetErrors();
     738                invalidateValidatorLayers();
     739            }
     740        }
     741    }
    733742}
  • src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerDownAction.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerDownAction.java b/src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerDownAction.java
    index 425e9b208..bc6e1d67e 100644
    a b  
    1515import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1616import org.openstreetmap.josm.gui.layer.Layer;
    1717import org.openstreetmap.josm.gui.layer.MainLayerManager;
    18 import org.openstreetmap.josm.tools.ImageProvider;
    1918import org.openstreetmap.josm.tools.Shortcut;
    2019
    2120/**
     
    3332     * Create a CycleLayerDownAction that cycles through layers that are in the model
    3433     */
    3534    public CycleLayerDownAction() {
    36         super(tr("Cycle layer down"), "dialogs/previous", tr("Cycle through data layers in a downward direction"),
    37                 cycleDown, true, "cycle-layer-down", false);
    38         new ImageProvider("dialogs", "previous").getResource().attachImageIcon(this, true);
    39         putValue(SHORT_DESCRIPTION, tr("Cycle through visible layers."));
    40         putValue(NAME, tr("Cycle layers"));
     35        super(false);
     36        setName(tr("Cycle layers"));
     37        setIcon("dialogs/previous");
     38        setShortcut(cycleDown);
     39        setTooltip(tr("Cycle through visible layers."));
     40        registerInToolbar("cycle-layer-down");
    4141    }
    4242
    4343    @Override
  • src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerUpAction.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerUpAction.java b/src/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerUpAction.java
    index d9adff6e2..742e7c531 100644
    a b  
    1313import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1414import org.openstreetmap.josm.gui.layer.Layer;
    1515import org.openstreetmap.josm.gui.layer.MainLayerManager;
    16 import org.openstreetmap.josm.tools.ImageProvider;
    1716import org.openstreetmap.josm.tools.Shortcut;
    1817
    1918/**
     
    3130     * Create a CycleLayerDownAction that cycles through layers that are in the model
    3231     */
    3332    public CycleLayerUpAction() {
    34         super(tr("Cycle layer up"), "dialogs/next", tr("Cycle through data layers in an upward direction"),
    35                 cycleUp, true, "cycle-layer-up", false);
    36         new ImageProvider("dialogs", "next").getResource().attachImageIcon(this, true);
    37         putValue(SHORT_DESCRIPTION, tr("Cycle through visible layers."));
    38         putValue(NAME, tr("Cycle layers"));
     33        super(false);
     34        setName(tr("Cycle layers"));
     35        setIcon("dialogs/next");
     36        setShortcut(cycleUp);
     37        setTooltip(tr("Cycle through visible layers."));
     38        registerInToolbar("cycle-layer-up");
    3939    }
    4040
    4141    @Override
  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java b/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
    index d2883342c..7b8e2fbe4 100644
    a b public boolean isCellEditable(int row, int column) {  
    10791079        private static final String DELETE_FROM_RELATION_PREF = "delete_from_relation";
    10801080
    10811081        DeleteAction() {
    1082             super(tr("Delete"), /* ICON() */ "dialogs/delete", tr("Delete the selected key in all objects"),
    1083                     Shortcut.registerShortcut("properties:delete", tr("Delete Tags"), KeyEvent.VK_D,
    1084                             Shortcut.ALT_CTRL_SHIFT), false);
     1082            setName(tr("Delete"));
     1083            setIcon(/* ICON() */ "dialogs/delete");
     1084            setShortcut(Shortcut.registerShortcut("properties:delete", tr("Delete Tags"), KeyEvent.VK_D, Shortcut.ALT_CTRL_SHIFT));
     1085            setTooltip(tr("Delete the selected key in all objects"));
     1086            setToolbarId("dialogs/delete");
    10851087            updateEnabledState();
    10861088        }
    10871089
    public void valueChanged(ListSelectionEvent e) {  
    11891191    class AddAction extends JosmAction {
    11901192        AtomicBoolean isPerforming = new AtomicBoolean(false);
    11911193        AddAction() {
    1192             super(tr("Add"), /* ICON() */ "dialogs/add", tr("Add a new key/value pair to all objects"),
    1193                     Shortcut.registerShortcut("properties:add", tr("Add Tag"), KeyEvent.VK_A,
    1194                             Shortcut.ALT), false);
     1194            setName(tr("Add"));
     1195            setIcon(/* ICON() */ "dialogs/add");
     1196            setShortcut(Shortcut.registerShortcut("properties:add", tr("Add Tag"), KeyEvent.VK_A, Shortcut.ALT));
     1197            setTooltip(tr("Add a new key/value pair to all objects"));
     1198            setToolbarId("dialogs/add");
    11951199        }
    11961200
    11971201        @Override
    public void actionPerformed(ActionEvent e) {  
    12141218    class EditAction extends JosmAction implements ListSelectionListener {
    12151219        AtomicBoolean isPerforming = new AtomicBoolean(false);
    12161220        EditAction() {
    1217             super(tr("Edit"), /* ICON() */ "dialogs/edit", tr("Edit the value of the selected key for all objects"),
    1218                     Shortcut.registerShortcut("properties:edit", tr("Edit Tags"), KeyEvent.VK_S,
    1219                             Shortcut.ALT), false);
     1221            setName(tr("Edit"));
     1222            setIcon(/* ICON() */ "dialogs/edit");
     1223            setShortcut(Shortcut.registerShortcut("properties:edit", tr("Edit Tags"), KeyEvent.VK_S, Shortcut.ALT));
     1224            setTooltip(tr("Edit the value of the selected key for all objects"));
     1225            setToolbarId("dialogs/edit");
    12201226            updateEnabledState();
    12211227        }
    12221228
  • src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java b/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
    index 57a52a381..e0a28e84c 100644
    a b protected void buildRecentTagsPanel() {  
    947947                /* POSSIBLE SHORTCUTS: 1,2,3,4,5,6,7,8,9,0=10 */
    948948                final Shortcut sc = count > 10 ? null : Shortcut.registerShortcut("properties:recent:" + count,
    949949                        tr("Choose recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL);
    950                 final JosmAction action = new JosmAction(
    951                         tr("Choose recent tag {0}", count), null, tr("Use this tag again"), sc, false) {
     950                int finalCount = count;
     951                final JosmAction action = new JosmAction(false) {
     952                    {
     953                        setName(tr("Choose recent tag {0}", finalCount));
     954                        setShortcut(sc);
     955                        setTooltip(tr("Use this tag again"));
     956                    }
    952957                    @Override
    953958                    public void actionPerformed(ActionEvent e) {
    954959                        keys.setSelectedItem(t.getKey(), true);
    public void actionPerformed(ActionEvent e) {  
    961966                /* POSSIBLE SHORTCUTS: 1,2,3,4,5,6,7,8,9,0=10 */
    962967                final Shortcut scShift = count > 10 ? null : Shortcut.registerShortcut("properties:recent:apply:" + count,
    963968                         tr("Apply recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL_SHIFT);
    964                 final JosmAction actionShift = new JosmAction(
    965                         tr("Apply recent tag {0}", count), null, tr("Use this tag again"), scShift, false) {
     969                final JosmAction actionShift = new JosmAction(false) {
     970                    {
     971                        setName(tr("Apply recent tag {0}", finalCount));
     972                        setShortcut(scShift);
     973                        setTooltip(tr("Use this tag again"));
     974                    }
    966975                    @Override
    967976                    public void actionPerformed(ActionEvent e) {
    968977                        action.actionPerformed(null);
  • src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java b/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
    index b52f923a1..1f6cb61aa 100644
    a b public void setVisible(boolean visible) {  
    751751    protected static JMenuItem addToWindowMenu(IRelationEditor re, String layerName) {
    752752        Relation r = re.getRelation();
    753753        String name = r == null ? tr("New relation") : r.getLocalName();
    754         JosmAction focusAction = new JosmAction(
    755                 tr("Relation Editor: {0}", name == null && r != null ? r.getId() : name),
    756                 "dialogs/relationlist",
    757                 tr("Focus Relation Editor with relation ''{0}'' in layer ''{1}''", name, layerName),
    758                 null, false, false) {
     754        JosmAction focusAction = new JosmAction(false) {
     755            {
     756                setName(tr("Relation Editor: {0}", name == null && r != null ? r.getId() : name));
     757                setIcon("dialogs/relationlist");
     758                setTooltip(tr("Focus Relation Editor with relation ''{0}'' in layer ''{1}''", name, layerName));
     759            }
    759760            private static final long serialVersionUID = 1L;
    760761
    761762            @Override
  • src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    diff --git a/src/org/openstreetmap/josm/gui/help/HelpBrowser.java b/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
    index 8b649ef11..c968c54a0 100644
    a b  
    7171
    7272    private final transient HelpContentReader reader;
    7373
    74     private static final JosmAction FOCUS_ACTION = new JosmAction(tr("JOSM Help Browser"), "help", "", null, false, false) {
     74    private static final JosmAction FOCUS_ACTION = new JosmAction(false) {
     75        {
     76            setName(tr("JOSM Help Browser"));
     77            setIcon("help");
     78        }
    7579        @Override
    7680        public void actionPerformed(ActionEvent e) {
    7781            HelpBrowser.getInstance().setVisible(true);
  • src/org/openstreetmap/josm/gui/history/VersionTable.java

    diff --git a/src/org/openstreetmap/josm/gui/history/VersionTable.java b/src/org/openstreetmap/josm/gui/history/VersionTable.java
    index fb7263a6f..1e337e5a8 100644
    a b  
    3737import org.openstreetmap.josm.io.XmlWriter;
    3838import org.openstreetmap.josm.spi.preferences.Config;
    3939import org.openstreetmap.josm.tools.Destroyable;
    40 import org.openstreetmap.josm.tools.ImageProvider;
    4140import org.openstreetmap.josm.tools.OpenBrowser;
    4241
    4342/**
    protected int checkTableSelection(JTable table, Point p) {  
    162161         */
    163162        ChangesetInfoAction() {
    164163            super(true);
    165             putValue(NAME, tr("Changeset info"));
    166             putValue(SHORT_DESCRIPTION, tr("Launch browser with information about the changeset"));
    167             new ImageProvider("data/changeset").getResource().attachImageIcon(this, true);
     164            setName(tr("Changeset info"));
     165            setTooltip(tr("Launch browser with information about the changeset"));
     166            setIcon("data/changeset");
    168167        }
    169168
    170169        @Override
    public void prepare(HistoryOsmPrimitive primitive) {  
    199198         */
    200199        UserInfoAction() {
    201200            super(true);
    202             putValue(NAME, tr("User info"));
    203             putValue(SHORT_DESCRIPTION, tr("Launch browser with information about the user"));
    204             new ImageProvider("data/user").getResource().attachImageIcon(this, true);
     201            setName(tr("User info"));
     202            setTooltip(tr("Launch browser with information about the user"));
     203            setIcon("data/user");
    205204        }
    206205
    207206        @Override
  • src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java b/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
    index ad5d0e9ea..a0b9c06c9 100644
    a b public void destroy() {  
    201201
    202202    private class ImageNextAction extends JosmAction {
    203203        ImageNextAction() {
    204             super(null, new ImageProvider("dialogs", "next"), tr("Next"), Shortcut.registerShortcut(
    205                     "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT),
    206                   false, null, false);
     204            setIcon(new ImageProvider("dialogs", "next"));
     205            setShortcut(Shortcut.registerShortcut(
     206                        "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT));
     207            setTooltip(tr("Next"));
    207208        }
    208209
    209210        @Override
    public void actionPerformed(ActionEvent e) {  
    216217
    217218    private class ImagePreviousAction extends JosmAction {
    218219        ImagePreviousAction() {
    219             super(null, new ImageProvider("dialogs", "previous"), tr("Previous"), Shortcut.registerShortcut(
    220                     "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT),
    221                   false, null, false);
     220            setIcon(new ImageProvider("dialogs", "previous"));
     221            setShortcut(Shortcut.registerShortcut(
     222                        "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT));
     223            setTooltip(tr("Previous"));
    222224        }
    223225
    224226        @Override
    public void actionPerformed(ActionEvent e) {  
    231233
    232234    private class ImageFirstAction extends JosmAction {
    233235        ImageFirstAction() {
    234             super(null, new ImageProvider("dialogs", "first"), tr("First"), Shortcut.registerShortcut(
    235                     "geoimage:first", tr("Geoimage: {0}", tr("Show first Image")), KeyEvent.VK_HOME, Shortcut.DIRECT),
    236                   false, null, false);
     236            setIcon(new ImageProvider("dialogs", "first"));
     237            setShortcut(Shortcut.registerShortcut(
     238                        "geoimage:first", tr("Geoimage: {0}", tr("Show first Image")), KeyEvent.VK_HOME, Shortcut.DIRECT));
     239            setTooltip(tr("First"));
    237240        }
    238241
    239242        @Override
    public void actionPerformed(ActionEvent e) {  
    246249
    247250    private class ImageLastAction extends JosmAction {
    248251        ImageLastAction() {
    249             super(null, new ImageProvider("dialogs", "last"), tr("Last"), Shortcut.registerShortcut(
    250                     "geoimage:last", tr("Geoimage: {0}", tr("Show last Image")), KeyEvent.VK_END, Shortcut.DIRECT),
    251                   false, null, false);
     252            setIcon(new ImageProvider("dialogs", "last"));
     253            setShortcut(Shortcut.registerShortcut(
     254                        "geoimage:last", tr("Geoimage: {0}", tr("Show last Image")), KeyEvent.VK_END, Shortcut.DIRECT));
     255            setTooltip(tr("Last"));
    252256        }
    253257
    254258        @Override
    public void actionPerformed(ActionEvent e) {  
    261265
    262266    private class ImageCenterViewAction extends JosmAction {
    263267        ImageCenterViewAction() {
    264             super(null, new ImageProvider("dialogs/autoscale", "selection"), tr("Center view"), null,
    265                   false, null, false);
     268            setIcon(new ImageProvider("dialogs/autoscale", "selection"));
     269            setTooltip(tr("Center view"));
    266270        }
    267271
    268272        @Override
    public void actionPerformed(ActionEvent e) {  
    277281
    278282    private class ImageZoomAction extends JosmAction {
    279283        ImageZoomAction() {
    280             super(null, new ImageProvider("dialogs", "zoom-best-fit"), tr("Zoom best fit and 1:1"), null,
    281                   false, null, false);
     284            setIcon(new ImageProvider("dialogs", "zoom-best-fit"));
     285            setTooltip(tr("Zoom best fit and 1:1"));
    282286        }
    283287
    284288        @Override
    public void actionPerformed(ActionEvent e) {  
    289293
    290294    private class ImageRemoveAction extends JosmAction {
    291295        ImageRemoveAction() {
    292             super(null, new ImageProvider("dialogs", "delete"), tr("Remove photo from layer"), Shortcut.registerShortcut(
    293                     "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT),
    294                   false, null, false);
     296            setIcon(new ImageProvider("dialogs", "delete"));
     297            setShortcut(Shortcut.registerShortcut("geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")),
     298                    KeyEvent.VK_DELETE, Shortcut.SHIFT));
     299            setTooltip(tr("Remove photo from layer"));
    295300        }
    296301
    297302        @Override
    public void actionPerformed(ActionEvent e) {  
    304309
    305310    private class ImageRemoveFromDiskAction extends JosmAction {
    306311        ImageRemoveFromDiskAction() {
    307             super(null, new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete image file from disk"),
    308                     Shortcut.registerShortcut("geoimage:deletefilefromdisk",
    309                             tr("Geoimage: {0}", tr("Delete image file from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT),
    310                     false, null, false);
     312            setIcon(new ImageProvider("dialogs", "geoimage/deletefromdisk"));
     313            setShortcut(Shortcut.registerShortcut("geoimage:deletefilefromdisk",
     314                                tr("Geoimage: {0}", tr("Delete image file from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT));
     315            setTooltip(tr("Delete image file from disk"));
    311316        }
    312317
    313318        @Override
    public void actionPerformed(ActionEvent e) {  
    354359
    355360    private class ImageCopyPathAction extends JosmAction {
    356361        ImageCopyPathAction() {
    357             super(null, new ImageProvider("copy"), tr("Copy image path"), Shortcut.registerShortcut(
    358                     "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT),
    359                   false, null, false);
     362            setIcon(new ImageProvider("copy"));
     363            setShortcut(Shortcut.registerShortcut(
     364                        "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT));
     365            setTooltip(tr("Copy image path"));
    360366        }
    361367
    362368        @Override
    public void actionPerformed(ActionEvent e) {  
    369375
    370376    private class ImageCollapseAction extends JosmAction {
    371377        ImageCollapseAction() {
    372             super(null, new ImageProvider("dialogs", "collapse"), tr("Move dialog to the side pane"), null,
    373                   false, null, false);
     378            setIcon(new ImageProvider("dialogs", "collapse"));
     379            setTooltip(tr("Move dialog to the side pane"));
    374380        }
    375381
    376382        @Override
  • src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java b/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
    index 0041769d7..785bca1b9 100644
    a b  
    3939     * @param data The GPX data used to download along
    4040     */
    4141    public DownloadAlongTrackAction(GpxData data) {
    42         super(tr("Download from OSM along this track"), "downloadalongtrack", null, null, false);
     42        setName(tr("Download from OSM along this track"));
     43        setIcon("downloadalongtrack");
     44        setToolbarId("downloadalongtrack");
    4345        this.data = data;
    4446    }
    4547
  • src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java

    diff --git a/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java b/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
    index f7575f772..6e45b6795 100644
    a b  
    3232        private final JCheckBoxMenuItem button;
    3333
    3434        MapPaintAction(StyleSource style) {
    35             super(style.getDisplayString(), style.getIconProvider(),
    36                     tr("Select the map painting styles"), null, true, "mappaint/" + style.getDisplayString(), true);
     35            setName(style.getDisplayString());
     36            setIcon(style.getIconProvider());
     37            setTooltip(tr("Select the map painting styles"));
     38            registerInToolbar("mappaint/" + style.getDisplayString());
    3739            this.button = new StayOpenCheckBoxMenuItem(this);
    3840            this.style = style;
    3941            updateButton();
  • src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
    index cdfe3a466..a50819543 100644
    a b  
    3232         * Constructs a new {@link TaggingPresetSearchPrimitiveDialog.Action}.
    3333         */
    3434        public Action() {
    35             super(tr("Search for objects by preset..."), "dialogs/search", tr("Search for objects by their presets."),
    36                     Shortcut.registerShortcut("preset:search-objects", tr("Search for objects by preset"), KeyEvent.VK_F3, Shortcut.SHIFT),
    37                     false);
     35            setName(tr("Search for objects by preset..."));
     36            setIcon("dialogs/search");
     37            setShortcut(Shortcut.registerShortcut("preset:search-objects", tr("Search for objects by preset"), KeyEvent.VK_F3, Shortcut.SHIFT));
     38            setTooltip(tr("Search for objects by their presets."));
     39            setToolbarId("dialogs/search");
    3840            putValue("toolbar", "presets/search-objects");
    3941            MainApplication.getToolbar().register(this);
    4042        }