Changeset 6070 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
- Timestamp:
- 2013-07-17T00:01:49+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r6020 r6070 147 147 return new ActionDefinition(null); 148 148 } 149 149 150 150 public boolean hasParameters() { 151 151 if (!(getAction() instanceof ParameterizedAction)) return false; 152 152 for (Object o: parameters.values()) { 153 153 if (o!=null) return true; 154 } 154 } 155 155 return false; 156 156 } … … 412 412 } 413 413 }); 414 414 415 415 JMenuItem configure = new JMenuItem(new AbstractAction(tr("Configure toolbar")) { 416 416 @Override … … 430 430 p.setVisible(true); 431 431 // refresh toolbar to try using changed shortcuts without restart 432 Main.toolbar.refreshToolbarControl(); 432 Main.toolbar.refreshToolbarControl(); 433 433 } 434 434 }); … … 485 485 486 486 private final class Move implements ActionListener { 487 @Override 487 @Override 488 488 public void actionPerformed(ActionEvent e) { 489 489 if (e.getActionCommand().equals("<") && actionsTree.getSelectionCount() > 0) { … … 1032 1032 final JButton b = addButtonAndShortcut(action); 1033 1033 buttonActions.put(b, action); 1034 1034 1035 1035 Icon i = action.getDisplayIcon(); 1036 1036 if (i != null) { … … 1055 1055 control.setVisible(control.getComponentCount() != 0); 1056 1056 } 1057 1057 1058 1058 private JButton addButtonAndShortcut(ActionDefinition action) { 1059 1059 Action act = action.getParametrizedAction(); 1060 1060 JButton b = control.add(act); 1061 1061 1062 1062 Shortcut sc = null; 1063 1063 if (action.getAction() instanceof JosmAction) { … … 1072 1072 paramCode = action.parameters.hashCode(); 1073 1073 } 1074 1074 1075 1075 String tt = action.getDisplayTooltip(); 1076 1076 if (tt==null) { … … 1091 1091 Main.unregisterShortcut(sc); 1092 1092 Main.registerActionShortcut(act, sc); 1093 1093 1094 1094 // add shortcut info to the tooltip if needed 1095 1095 if (sc.getAssignedUser()) { … … 1100 1100 } 1101 1101 } 1102 1102 1103 1103 if (!tt.isEmpty()) { 1104 1104 b.setToolTipText(tt);
Note:
See TracChangeset
for help on using the changeset viewer.