Changeset 5079 in josm
- Timestamp:
- 2012-03-14T12:16:08+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r4968 r5079 369 369 private static class ToolbarPopupMenu extends JPopupMenu { 370 370 public ToolbarPopupMenu(final ActionDefinition action) { 371 372 add(tr("Remove from toolbar",action.getDisplayName())) 373 .addActionListener(new ActionListener() { 374 public void actionPerformed(ActionEvent e) { 375 Collection<String> t = new LinkedList<String>(getToolString()); 376 ActionParser parser = new ActionParser(null); 377 // get text definition of current action 378 String res = parser.saveAction(action); 379 // remove the button from toolbar preferences 380 t.remove( res ); 381 Main.pref.putCollection("toolbar", t); 382 Main.toolbar.refreshToolbarControl(); 383 } 384 }); 371 372 if(action != null) { 373 add(tr("Remove from toolbar",action.getDisplayName())) 374 .addActionListener(new ActionListener() { 375 public void actionPerformed(ActionEvent e) { 376 Collection<String> t = new LinkedList<String>(getToolString()); 377 ActionParser parser = new ActionParser(null); 378 // get text definition of current action 379 String res = parser.saveAction(action); 380 // remove the button from toolbar preferences 381 t.remove( res ); 382 Main.pref.putCollection("toolbar", t); 383 Main.toolbar.refreshToolbarControl(); 384 } 385 }); 386 } 385 387 386 388 add(tr("Configure toolbar")).addActionListener(new ActionListener() { … … 801 803 public ToolbarPreferences() { 802 804 control.setFloatable(false); 805 control.addMouseListener(new PopupMenuLauncher(new ToolbarPopupMenu(null))); 803 806 } 804 807
Note:
See TracChangeset
for help on using the changeset viewer.