Ignore:
Timestamp:
2006-10-08T17:29:58+02:00 (20 years ago)
Author:
imi
Message:
  • added online help system
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/Main.java

    r154 r155  
    88import java.awt.Toolkit;
    99import java.awt.event.ActionEvent;
     10import java.awt.event.KeyEvent;
    1011import java.io.File;
    1112import java.net.URI;
     
    2223import javax.swing.AbstractAction;
    2324import javax.swing.Action;
     25import javax.swing.JComponent;
    2426import javax.swing.JMenu;
    2527import javax.swing.JMenuBar;
     
    2830import javax.swing.JSeparator;
    2931import javax.swing.JToolBar;
    30 import javax.swing.SwingUtilities;
     32import javax.swing.KeyStroke;
    3133import javax.swing.UIManager;
    3234
     
    3739import org.openstreetmap.josm.actions.ExternalToolsAction;
    3840import org.openstreetmap.josm.actions.GpxExportAction;
     41import org.openstreetmap.josm.actions.HelpAction;
    3942import org.openstreetmap.josm.actions.OpenAction;
    4043import org.openstreetmap.josm.actions.PreferencesAction;
     
    104107         */
    105108        public static PleaseWaitDialog pleaseWaitDlg;
     109        /**
     110         * The access to the help subsystem
     111         */
     112        public HelpAction help;
    106113
    107114
     
    192199                final Action exitAction = new ExitAction();
    193200                final Action preferencesAction = new PreferencesAction();
     201                help = new HelpAction();
    194202                final Action aboutAction = new AboutAction();
    195203
     
    235243                final JMenu helpMenu = new JMenu(tr("Help"));
    236244                helpMenu.setMnemonic('H');
     245                helpMenu.add(help);
     246                helpMenu.add(aboutAction);
     247                helpMenu.addSeparator();
    237248                helpMenu.add(annotationTesterAction);
    238                 helpMenu.addSeparator();
    239                 helpMenu.add(aboutAction);
    240249                mainMenu.add(helpMenu);
    241250
     
    256265                contentPane.add(toolBar, BorderLayout.NORTH);
    257266
     267        contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), "Help");
     268        contentPane.getActionMap().put("Help", help);
     269
    258270                contentPane.updateUI();
    259 
    260                 // Plugins
    261                 if (Main.pref.hasKey("plugins")) {
     271        }
     272
     273        /**
     274         * Load all plugins specified in preferences. Has to be called after the complete
     275         * GUI has been set up. (post-constructor)
     276         */
     277        public void loadPlugins() {
     278            if (Main.pref.hasKey("plugins")) {
    262279                        for (String pluginName : Main.pref.get("plugins").split(",")) {
    263280                                try {
     
    273290                        }
    274291                }
    275 
    276                 SwingUtilities.updateComponentTreeUI(parent);
    277                 for (DownloadTask task : downloadAction.downloadTasks)
    278                         task.getCheckBox().updateUI();
    279         }
     292    }
    280293
    281294        /**
Note: See TracChangeset for help on using the changeset viewer.