Changeset 155 in josm for src/org/openstreetmap/josm/actions/JosmAction.java
- Timestamp:
- 2006-10-08T17:29:58+02:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/JosmAction.java
r113 r155 18 18 /** 19 19 * Construct the action as menu action entry. 20 * 20 * 21 21 * @param name Name of the action (entry name in menu) 22 22 * @param iconName Name of the icon (without extension) … … 33 33 public JosmAction(String name, String iconName, String tooltip, int shortCut, int modifier) { 34 34 super(name, ImageProvider.get(iconName)); 35 setHelpId(); 35 36 putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+ShortCutLabel.name(shortCut, modifier)+"</font> </html>"); 36 //Main.panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(shortCut, name);37 //Main.panel.getActionMap().put(name, this);38 37 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(shortCut, modifier), name); 39 38 Main.contentPane.getActionMap().put(name, this); … … 41 40 42 41 public JosmAction() { 42 setHelpId(); 43 } 44 45 46 private void setHelpId() { 47 String helpId = "Action/"+getClass().getName().substring(getClass().getName().lastIndexOf('.')+1); 48 if (helpId.endsWith("Action")) 49 helpId = helpId.substring(0, helpId.length()-6); 50 putValue("help", helpId); 43 51 } 44 52 }
Note:
See TracChangeset
for help on using the changeset viewer.
