Changeset 2389 in josm for trunk


Ignore:
Timestamp:
2009-11-03T05:32:40+01:00 (12 years ago)
Author:
Gubaer
Message:

see #3834: added context sensitive help?

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java

    r2347 r2389  
    1212
    1313import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.actions.HelpAction;
    1415import org.openstreetmap.josm.tools.LanguageInfo;
    1516
     
    205206
    206207    /**
     208     * Replies the global help action, if available. Otherwise, creates an instance
     209     * of {@see HelpAction}.
     210     *
     211     * @return
     212     */
     213    static private Action getHelpAction() {
     214        try {
     215            return Main.main.menu.help;
     216        } catch(NullPointerException e) {
     217            return new HelpAction();
     218        }
     219    }
     220
     221    /**
    207222     * Makes a component aware of context sensitive help.
    208223     *
     
    210225     * code. Example: /Dialog/RelationEditor is a relative help topic, /De:Help/Dialog/RelationEditor
    211226     * is not.
    212      *  
     227     *
    213228     * @param component the component  the component
    214229     * @param topic the help topic. Set to the default help topic if null.
     
    219234        }
    220235        component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F1"), "help");
    221         component.getActionMap().put("help", Main.main.menu.help);
     236        component.getActionMap().put("help", getHelpAction());
    222237        component.putClientProperty("help", relativeHelpTopic);
    223238    }
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r2372 r2389  
    22package org.openstreetmap.josm.plugins;
    33
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    56
     
    1314import java.util.Collection;
    1415import java.util.Collections;
    15 import java.util.HashMap;
    1616import java.util.LinkedList;
    1717import java.util.List;
    18 import java.util.Map;
    1918import java.util.SortedMap;
    2019import java.util.TreeMap;
     
    3332
    3433import org.openstreetmap.josm.Main;
    35 import org.openstreetmap.josm.actions.AboutAction;
    3634import org.openstreetmap.josm.data.Version;
    3735import org.openstreetmap.josm.gui.ExtendedDialog;
     
    10199            if(Main.pref.getInteger("pluginmanager.version", 0) < v)
    102100            {
    103                 doUpdate = tr("You updated your JOSM software\nTo prevent problems the plugins should be updated as well.\n"
     101                doUpdate = tr("You updated your JOSM software.\nTo prevent problems the plugins should be updated as well.\n"
    104102                        + "Update plugins now?");
    105103                check = "pluginmanger.version";
     
    128126                dialog.toggleEnable(check);
    129127                dialog.setButtonIcons( new String[] {"dialogs/refresh.png", "cancel.png"});
     128                dialog.configureContextsensitiveHelp(ht("/Plugin/AutomaticUpdate"), true /* show help button */);
    130129                dialog.showDialog();
    131                 if(dialog.getValue() == 1)
     130                if(dialog.getValue() == 1) {
    132131                    new PluginSelection().update();
     132                }
    133133            }
    134134        }
Note: See TracChangeset for help on using the changeset viewer.