| Line | |
|---|
| 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others |
|---|
| 2 | package org.openstreetmap.josm.actions; |
|---|
| 3 | |
|---|
| 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht; |
|---|
| 5 | import static org.openstreetmap.josm.tools.I18n.tr; |
|---|
| 6 | |
|---|
| 7 | import java.awt.event.ActionEvent; |
|---|
| 8 | import java.awt.event.KeyEvent; |
|---|
| 9 | |
|---|
| 10 | import org.openstreetmap.josm.Main; |
|---|
| 11 | import org.openstreetmap.josm.gui.preferences.PreferenceDialog; |
|---|
| 12 | import org.openstreetmap.josm.tools.Shortcut; |
|---|
| 13 | |
|---|
| 14 | /** |
|---|
| 15 | * Open the Preferences dialog. |
|---|
| 16 | * |
|---|
| 17 | * @author imi |
|---|
| 18 | */ |
|---|
| 19 | public class PreferencesAction extends JosmAction implements Runnable { |
|---|
| 20 | |
|---|
| 21 | /** |
|---|
| 22 | * Create the preference action with "&Preferences" as label. |
|---|
| 23 | */ |
|---|
| 24 | public PreferencesAction() { |
|---|
| 25 | super(tr("Preferences..."), "preference", tr("Open a preferences dialog for global settings."), |
|---|
| 26 | Shortcut.registerShortcut("system:preferences", tr("Preferences"), KeyEvent.VK_F12, Shortcut.GROUP_DIRECT), true); |
|---|
| 27 | putValue("help", ht("/Action/Preferences")); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * Launch the preferences dialog. |
|---|
| 32 | */ |
|---|
| 33 | public void actionPerformed(ActionEvent e) { |
|---|
| 34 | run(); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | public void run() { |
|---|
| 38 | new PreferenceDialog(Main.parent).setVisible(true); |
|---|
| 39 | } |
|---|
| 40 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.