- Timestamp:
- 2021-03-25T22:58:47+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PreferenceToggleAction.java
r17021 r17667 18 18 * register another {@link PreferenceChangedListener} for the given preference key. 19 19 */ 20 public class PreferenceToggleAction extends JosmAction implements PreferenceChangedListener {20 public class PreferenceToggleAction extends ToggleAction implements PreferenceChangedListener { 21 21 22 22 private final JCheckBoxMenuItem checkbox; -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r17307 r17667 32 32 33 33 import javax.swing.AbstractAction; 34 import javax.swing.AbstractButton; 34 35 import javax.swing.Action; 35 36 import javax.swing.DefaultListCellRenderer; … … 68 69 import org.openstreetmap.josm.actions.ParameterizedAction; 69 70 import org.openstreetmap.josm.actions.ParameterizedActionDecorator; 71 import org.openstreetmap.josm.actions.ToggleAction; 70 72 import org.openstreetmap.josm.data.imagery.ImageryInfo; 71 73 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; 74 import org.openstreetmap.josm.gui.IconToggleButton; 72 75 import org.openstreetmap.josm.gui.MainApplication; 73 76 import org.openstreetmap.josm.gui.MapFrame; … … 1170 1173 control.addSeparator(); 1171 1174 } else { 1172 final JButton b = addButtonAndShortcut(action);1175 final AbstractButton b = addButtonAndShortcut(action); 1173 1176 buttonActions.put(b, action); 1174 1177 … … 1230 1233 } 1231 1234 1232 private JButton addButtonAndShortcut(ActionDefinition action) {1235 private AbstractButton addButtonAndShortcut(ActionDefinition action) { 1233 1236 Action act = action.getParametrizedAction(); 1234 JButton b = control.add(act); 1237 final AbstractButton b; 1238 if (act instanceof ToggleAction) { 1239 b = new IconToggleButton(act); 1240 control.add(b); 1241 } else { 1242 b = control.add(act); 1243 } 1235 1244 1236 1245 Shortcut sc = null;
Note:
See TracChangeset
for help on using the changeset viewer.