Changeset 4139 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
- Timestamp:
- 2011-06-18T15:26:52+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r4033 r4139 243 243 result.setLength(0); 244 244 245 escape((String) action.getAction().getValue("toolbar")); 245 String val = (String) action.getAction().getValue("toolbar"); 246 if(val == null) 247 return null; 248 escape(val); 246 249 if (action.getAction() instanceof ParameterizedAction) { 247 250 result.append('('); … … 753 756 t.add("|"); 754 757 } else { 755 t.add(parser.saveAction(action)); 758 String res = parser.saveAction(action); 759 if(res != null) 760 t.add(res); 756 761 } 757 762 } … … 783 788 Action action = menuItem.getAction(); 784 789 userObject = action; 785 actions.put((String) action.getValue("toolbar"), action); 790 String toolbar = (String) action.getValue("toolbar"); 791 if(toolbar == null) { 792 System.out.println(tr("Toolbar action without name: {0}", 793 action.getClass().getName())); 794 } else { 795 Action r = actions.get(toolbar); 796 if(r != null && r != action) { 797 System.out.println(tr("Toolbar action {0} overwritten: {1} gets {2}", 798 toolbar, r.getClass().getName(), action.getClass().getName())); 799 } 800 } 801 actions.put(toolbar, action); 786 802 } else { 787 803 userObject = menuItem.getText(); … … 862 878 */ 863 879 public Action register(Action action) { 864 regactions.put((String) action.getValue("toolbar"), action); 880 String toolbar = (String) action.getValue("toolbar"); 881 if(toolbar == null) { 882 System.out.println(tr("Registered toolbar action without name: {0}", 883 action.getClass().getName())); 884 } else { 885 Action r = regactions.get(toolbar); 886 if(r != null) { 887 System.out.println(tr("Registered toolbar action {0} overwritten: {1} gets {2}", 888 toolbar, r.getClass().getName(), action.getClass().getName())); 889 } 890 } 891 regactions.put(toolbar, action); 865 892 return action; 866 893 }
Note:
See TracChangeset
for help on using the changeset viewer.