Changeset 13840 in josm
- Timestamp:
- 2018-05-26T13:45:02+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
r12678 r13840 16 16 17 17 import javax.swing.AbstractAction; 18 import javax.swing.Action;19 18 import javax.swing.Icon; 20 19 import javax.swing.JButton; … … 24 23 import javax.swing.event.ChangeListener; 25 24 25 import org.openstreetmap.josm.actions.JosmAction; 26 26 import org.openstreetmap.josm.gui.help.HelpBrowser; 27 27 import org.openstreetmap.josm.gui.help.HelpUtil; … … 180 180 * @return the help button 181 181 */ 182 private static JButton createHelpButton(final String helpTopic) { 183 JButton b = new JButton(tr("Help")); 184 b.setIcon(ImageProvider.get("help")); 185 b.setToolTipText(tr("Show help information")); 182 private static JButton createHelpButton(String helpTopic) { 183 JButton b = new JButton(new HelpAction(helpTopic)); 186 184 HelpUtil.setHelpContext(b, helpTopic); 187 Action a = new AbstractAction() {188 @Override189 public void actionPerformed(ActionEvent e) {190 HelpBrowser.setUrlForHelpTopic(helpTopic);191 }192 };193 b.addActionListener(a);194 185 InputMapUtils.enableEnter(b); 195 186 return b; 187 } 188 189 private static class HelpAction extends JosmAction { 190 private final String helpTopic; 191 192 HelpAction(String helpTopic) { 193 super(tr("Help"), "help", tr("Show help information"), null, false, false); 194 this.helpTopic = helpTopic; 195 } 196 197 @Override 198 public void actionPerformed(ActionEvent e) { 199 HelpBrowser.setUrlForHelpTopic(helpTopic); 200 } 196 201 } 197 202
Note:
See TracChangeset
for help on using the changeset viewer.