Changeset 14690 in josm


Ignore:
Timestamp:
2019-01-13T11:17:04+01:00 (5 weeks ago)
Author:
simon04
Message:

see #17202 - Use Shortcut#setTooltip to fix deprecations

Location:
trunk/src/org/openstreetmap/josm
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r14397 r14690  
    3737import org.openstreetmap.josm.tools.ImageResource;
    3838import org.openstreetmap.josm.tools.Logging;
    39 import org.openstreetmap.josm.tools.PlatformManager;
    4039import org.openstreetmap.josm.tools.Shortcut;
    4140
     
    295294     */
    296295    public final void setTooltip(String tooltip) {
    297         if (tooltip != null) {
    298             putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tooltip, sc));
     296        if (tooltip != null && sc != null) {
     297            sc.setTooltip(this, tooltip);
     298        } else if (tooltip != null) {
     299            putValue(SHORT_DESCRIPTION, tooltip);
    299300        }
    300301    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r14212 r14690  
    5050import org.openstreetmap.josm.tools.ImageProvider;
    5151import org.openstreetmap.josm.tools.InputMapUtils;
    52 import org.openstreetmap.josm.tools.PlatformManager;
    5352import org.openstreetmap.josm.tools.Shortcut;
    5453
     
    104103
    105104    private static final String[] COLUMN_TOOLTIPS = {
    106             PlatformManager.getPlatform().makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),
    107             PlatformManager.getPlatform().makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),
     105            Shortcut.makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT.getKeyStroke()),
     106            Shortcut.makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT.getKeyStroke()),
    108107            null,
    109108            tr("Inverse filter"),
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java

    r14138 r14690  
    1111import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationMemberTask;
    1212import org.openstreetmap.josm.tools.ImageProvider;
    13 import org.openstreetmap.josm.tools.PlatformManager;
    1413import org.openstreetmap.josm.tools.Shortcut;
    1514
     
    3130            KeyEvent.VK_HOME, Shortcut.ALT);
    3231        sc.setAccelerator(this);
    33         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Download all incomplete members"), sc));
     32        sc.setTooltip(this, tr("Download all incomplete members"));
    3433        new ImageProvider("dialogs/relation", "downloadincomplete").getResource().attachImageIcon(this, true);
    3534        putValue(NAME, tr("Download members"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java

    r14138 r14690  
    88
    99import org.openstreetmap.josm.tools.ImageProvider;
    10 import org.openstreetmap.josm.tools.PlatformManager;
    1110import org.openstreetmap.josm.tools.Shortcut;
    1211
     
    2827        Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.ALT);
    2928        sc.setAccelerator(this);
    30         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members down"), sc));
     29        sc.setTooltip(this, tr("Move the currently selected members down"));
    3130        setEnabled(false);
    3231    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java

    r14138 r14690  
    88
    99import org.openstreetmap.josm.tools.ImageProvider;
    10 import org.openstreetmap.josm.tools.PlatformManager;
    1110import org.openstreetmap.josm.tools.Shortcut;
    1211
     
    2827        Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.ALT);
    2928        sc.setAccelerator(this);
    30         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members up"), sc));
     29        sc.setTooltip(this, tr("Move the currently selected members up"));
    3130        setEnabled(false);
    3231    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java

    r14470 r14690  
    1919import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
    2020import org.openstreetmap.josm.tools.ImageProvider;
    21 import org.openstreetmap.josm.tools.PlatformManager;
    2221import org.openstreetmap.josm.tools.Shortcut;
    2322
     
    3837        Shortcut sc = Shortcut.registerShortcut("relationeditor:refresh", tr("Relation Editor: Refresh"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
    3938        // CHECKSTYLE.ON: LineLength
    40         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Refresh relation from data layer"), sc));
     39        sc.setTooltip(this, tr("Refresh relation from data layer"));
    4140        new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true);
    4241        putValue(NAME, tr("Refresh"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java

    r14138 r14690  
    88
    99import org.openstreetmap.josm.tools.ImageProvider;
    10 import org.openstreetmap.josm.tools.PlatformManager;
    1110import org.openstreetmap.josm.tools.Shortcut;
    1211
     
    2928        Shortcut sc = Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, Shortcut.ALT);
    3029        sc.setAccelerator(this);
    31         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(
    32                 tr("Remove the currently selected members from this relation"), sc));
     30        sc.setTooltip(this, tr("Remove the currently selected members from this relation"));
    3331        setEnabled(false);
    3432    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java

    r14138 r14690  
    88
    99import org.openstreetmap.josm.tools.ImageProvider;
    10 import org.openstreetmap.josm.tools.PlatformManager;
    1110import org.openstreetmap.josm.tools.Shortcut;
    1211
     
    2827        Shortcut sc = Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_END, Shortcut.ALT);
    2928        sc.setAccelerator(this);
    30         putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Sort the relation members"), sc));
     29        sc.setTooltip(this, tr("Sort the relation members"));
    3130        updateEnabledState();
    3231    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r14153 r14690  
    7676import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    7777import org.openstreetmap.josm.tools.Logging;
    78 import org.openstreetmap.josm.tools.PlatformManager;
    7978import org.openstreetmap.josm.tools.Shortcut;
    8079
     
    12601259                    tt = tt.substring(6, tt.length()-6);
    12611260                }
    1262                 tt = PlatformManager.getPlatform().makeTooltip(tt, sc);
     1261                tt = Shortcut.makeTooltip(tt, sc.getKeyStroke());
    12631262            }
    12641263        }
Note: See TracChangeset for help on using the changeset viewer.