Changeset 11654 in josm
- Timestamp:
- 2017-03-03T22:37:42+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r11635 r11654 64 64 */ 65 65 public AddImageryLayerAction(ImageryInfo info) { 66 super(info.getMenuName(), /* ICON */"imagery_menu", tr("Add imagery layer {0}", info.getName()), null, false, false);67 putValue("toolbar", "imagery_" + info.getToolbarName());66 super(info.getMenuName(), /* ICON */"imagery_menu", tr("Add imagery layer {0}", info.getName()), null, 67 true, "imagery_" + info.getToolbarName(), false); 68 68 putValue("help", ht("/Preferences/Imagery")); 69 69 setTooltip(info.getToolTipText().replaceAll("</?html>", "")); … … 203 203 } 204 204 } 205 206 @Override 207 public String toString() { 208 return "AddImageryLayerAction [info=" + info + ']'; 209 } 205 210 } -
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r11348 r11654 15 15 import java.util.List; 16 16 import java.util.Locale; 17 import java.util.Optional; 17 18 18 19 import javax.swing.Action; … … 264 265 265 266 /** 266 * Remove all the items in @field dynamicItems collection267 * Remove all the items in dynamic items collection 267 268 * @since 5803 268 269 */ … … 270 271 for (Object item : dynamicItems) { 271 272 if (item instanceof JMenuItem) { 273 Optional.ofNullable(((JMenuItem) item).getAction()).ifPresent(Main.toolbar::unregister); 272 274 remove((JMenuItem) item); 273 } 274 if (item instanceof MenuComponent) { 275 } else if (item instanceof MenuComponent) { 275 276 remove((MenuComponent) item); 276 } 277 if (item instanceof Component) { 277 } else if (item instanceof Component) { 278 278 remove((Component) item); 279 279 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r11553 r11654 939 939 selected.addElement(actionDefinition); 940 940 } 941 actionsTreeModel.reload(); 941 942 } 942 943 … … 1077 1078 1078 1079 /** 1080 * Registers an action to the toolbar preferences. 1079 1081 * @param action Action to register 1080 1082 * @return The parameter (for better chaining) … … 1096 1098 } 1097 1099 return action; 1100 } 1101 1102 /** 1103 * Unregisters an action from the toolbar preferences. 1104 * @param action Action to unregister 1105 * @return The removed action, or null 1106 * @since 11654 1107 */ 1108 public Action unregister(Action action) { 1109 String toolbar = (String) action.getValue("toolbar"); 1110 if (toolbar != null) { 1111 return regactions.remove(toolbar); 1112 } 1113 return null; 1098 1114 } 1099 1115
Note:
See TracChangeset
for help on using the changeset viewer.