Changeset 13965 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-06-22T20:19:02+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
r13647 r13965 8 8 import java.awt.event.KeyEvent; 9 9 import java.beans.PropertyChangeListener; 10 import java.util.HashMap; 11 import java.util.Map; 10 12 11 13 import javax.swing.AbstractAction; … … 44 46 private static final String EDITABLE = "editable"; 45 47 48 private static final Map<String, ImageIcon> iconCache = new HashMap<>(); 49 50 private static ImageIcon loadIcon(String iconName) { 51 return iconCache.computeIfAbsent(iconName, 52 x -> new ImageProvider(iconName).setOptional(true).setSize(ImageProvider.ImageSizes.SMALLICON).get()); 53 } 54 46 55 protected JTextComponent component; 47 56 protected boolean undoRedo; … … 173 182 mi.setText(label); 174 183 if (iconName != null && Config.getPref().getBoolean("text.popupmenu.useicons", true)) { 175 ImageIcon icon = new ImageProvider(iconName).setOptional(true).setSize(ImageProvider.ImageSizes.SMALLICON).get();184 ImageIcon icon = loadIcon(iconName); 176 185 if (icon != null) { 177 186 mi.setIcon(icon);
Note:
See TracChangeset
for help on using the changeset viewer.