Changeset 9320 in josm
- Timestamp:
- 2016-01-05T15:34:45+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r8510 r9320 7 7 import java.awt.Point; 8 8 import java.awt.event.ActionEvent; 9 import java.awt.event.KeyEvent; 9 10 10 import javax.swing.AbstractAction;11 11 import javax.swing.SwingUtilities; 12 12 … … 15 15 import org.openstreetmap.josm.gui.help.HelpUtil; 16 16 import org.openstreetmap.josm.io.OnlineResource; 17 import org.openstreetmap.josm.tools. ImageProvider;17 import org.openstreetmap.josm.tools.Shortcut; 18 18 19 19 /** … … 21 21 * @since 155 22 22 */ 23 public class HelpAction extends AbstractAction {23 public class HelpAction extends JosmAction { 24 24 25 25 /** … … 27 27 */ 28 28 public HelpAction() { 29 super(tr("Help")); 30 new ImageProvider("help").getResource().getImageIcon(this); 31 putValue("toolbar", "help"); 29 this(true); 30 } 31 32 private HelpAction(boolean shortcut) { 33 super(tr("Help"), "help", null, 34 shortcut ? Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, Shortcut.DIRECT) : null, 35 true); 32 36 setEnabled(!Main.isOffline(OnlineResource.JOSM_WEBSITE)); 37 } 38 39 /** 40 * Constructs a new {@code HelpAction} without assigning a shortcut. 41 * @return a new {@code HelpAction} 42 */ 43 public static HelpAction createWithoutShortcut() { 44 return new HelpAction(false); 33 45 } 34 46 -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r9261 r9320 818 818 }); 819 819 820 helpMenu.add(statusreport);821 helpMenu.add(reportbug);820 add(helpMenu, statusreport); 821 add(helpMenu, reportbug); 822 822 helpMenu.addSeparator(); 823 823 824 // FIXME why is help not a JosmAction? 825 helpMenu.add(help).setAccelerator(Shortcut.registerShortcut("system:help", tr("Help"), KeyEvent.VK_F1, 826 Shortcut.DIRECT).getKeyStroke()); 824 add(helpMenu, help); 827 825 add(helpMenu, about); 828 826 add(Box.createHorizontalGlue()); -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r8846 r9320 192 192 return Main.main.menu.help; 193 193 } 194 return new HelpAction();194 return HelpAction.createWithoutShortcut(); 195 195 } 196 196
Note:
See TracChangeset
for help on using the changeset viewer.