Changeset 11553 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
- Timestamp:
- 2017-02-12T16:32:18+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r11344 r11553 27 27 import java.util.List; 28 28 import java.util.Map; 29 import java.util.Optional; 29 30 import java.util.concurrent.ConcurrentHashMap; 30 31 … … 160 161 if (ico != null) 161 162 return ico; 162 Object o = action.getValue(Action.LARGE_ICON_KEY); 163 if (o == null) 164 o = action.getValue(Action.SMALL_ICON); 165 return (Icon) o; 163 return (Icon) Optional.ofNullable(action.getValue(Action.LARGE_ICON_KEY)).orElseGet(() -> action.getValue(Action.SMALL_ICON)); 166 164 } 167 165 … … 1193 1191 } 1194 1192 1195 String tt = action.getDisplayTooltip(); 1196 if (tt == null) { 1197 tt = ""; 1198 } 1193 String tt = Optional.ofNullable(action.getDisplayTooltip()).orElse(""); 1199 1194 1200 1195 if (sc == null || paramCode != 0) { 1201 String name = (String) action.getAction().getValue("toolbar"); 1202 if (name == null) { 1203 name = action.getDisplayName(); 1204 } 1196 String name = Optional.ofNullable((String) action.getAction().getValue("toolbar")).orElseGet(action::getDisplayName); 1205 1197 if (paramCode != 0) { 1206 1198 name = name+paramCode;
Note:
See TracChangeset
for help on using the changeset viewer.