Changeset 18871 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
- Timestamp:
- 2023-10-16T19:03:11+02:00 (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r18801 r18871 24 24 import java.util.Collection; 25 25 import java.util.Collections; 26 import java.util.HashMap; 26 27 import java.util.LinkedList; 27 28 import java.util.List; … … 299 300 return null; 300 301 301 ActionDefinition result= new ActionDefinition(action);302 ActionDefinition actionDefinition = new ActionDefinition(action); 302 303 303 304 if (action instanceof ParameterizedAction) { … … 305 306 306 307 ParameterizedAction parametrizedAction = (ParameterizedAction) action; 307 Map<String, ActionParameter<?>> actionParams = new ConcurrentHashMap<>();308 Map<String, ActionParameter<?>> actionParams = new HashMap<>(); 308 309 for (ActionParameter<?> param: parametrizedAction.getActionParameters()) { 309 310 actionParams.put(param.getName(), param); … … 317 318 ActionParameter<?> actionParam = actionParams.get(paramName); 318 319 if (actionParam != null) { 319 result.getParameters().put(paramName, actionParam.readFromString(paramValue));320 actionDefinition.getParameters().put(paramName, actionParam.readFromString(paramValue)); 320 321 } 321 322 } … … 332 333 String paramValue = readTillChar(',', '}'); 333 334 if ("icon".equals(paramName) && !paramValue.isEmpty()) { 334 result.setIcon(paramValue);335 actionDefinition.setIcon(paramValue); 335 336 } else if ("name".equals(paramName) && !paramValue.isEmpty()) { 336 result.setName(paramValue);337 actionDefinition.setName(paramValue); 337 338 } 338 339 skip(','); … … 341 342 } 342 343 343 return result;344 return actionDefinition; 344 345 } 345 346 … … 798 799 private JButton createButton(String name) { 799 800 JButton b = new JButton(); 800 if ("up".equals(name)) { 801 b.setIcon(ImageProvider.get("dialogs", "up", ImageSizes.LARGEICON)); 802 b.setToolTipText(tr("Move the currently selected members up")); 803 } else if ("down".equals(name)) { 804 b.setIcon(ImageProvider.get("dialogs", "down", ImageSizes.LARGEICON)); 805 b.setToolTipText(tr("Move the currently selected members down")); 806 } else if ("<".equals(name)) { 807 b.setIcon(ImageProvider.get("dialogs/conflict", "copybeforecurrentright", ImageSizes.LARGEICON)); 808 b.setToolTipText(tr("Add all objects selected in the current dataset before the first selected member")); 809 } else if (">".equals(name)) { 810 b.setIcon(ImageProvider.get("dialogs", "delete", ImageSizes.LARGEICON)); 811 b.setToolTipText(tr("Remove")); 801 switch (name) { 802 case "up": 803 b.setIcon(ImageProvider.get("dialogs", "up", ImageSizes.LARGEICON)); 804 b.setToolTipText(tr("Move the currently selected members up")); 805 break; 806 case "down": 807 b.setIcon(ImageProvider.get("dialogs", "down", ImageSizes.LARGEICON)); 808 b.setToolTipText(tr("Move the currently selected members down")); 809 break; 810 case "<": 811 b.setIcon(ImageProvider.get("dialogs/conflict", "copybeforecurrentright", ImageSizes.LARGEICON)); 812 b.setToolTipText(tr("Add all objects selected in the current dataset before the first selected member")); 813 break; 814 case ">": 815 b.setIcon(ImageProvider.get("dialogs", "delete", ImageSizes.LARGEICON)); 816 b.setToolTipText(tr("Remove")); 817 break; 818 default: 819 // do nothing 812 820 } 813 821 b.addActionListener(moveAction); … … 1044 1052 continue; 1045 1053 } else if (!(tb instanceof String)) { 1046 if (!(tb instanceof Boolean) || (Boolean) tb) {1054 if (!(tb instanceof Boolean) || Boolean.TRUE.equals(tb)) { 1047 1055 Logging.info(tr("Strange toolbar value: {0}", 1048 1056 action.getClass().getName())); … … 1162 1170 /** 1163 1171 * Parse the toolbar preference setting and construct the toolbar GUI control. 1164 * 1172 * <p> 1165 1173 * Call this, if anything has changed in the toolbar settings and you want to refresh 1166 1174 * the toolbar content (e.g. after registering actions in a plugin)
Note:
See TracChangeset
for help on using the changeset viewer.