Ignore:
Timestamp:
2009-10-05T21:39:15+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3653: History for anonymous users should not be clickable
fixed #3518: Provide a new feature for uploading the currently selected primitives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/HelpAction.java

    r2163 r2250  
    123123        } else if (e.getActionCommand() == null) {
    124124            String topic = null;
    125             Point mouse = Main.parent.getMousePosition();
    126             if (mouse != null) {
     125            if (e.getSource() instanceof Component) {
     126                Component c = SwingUtilities.getRoot((Component)e.getSource());
     127                Point mouse = c.getMousePosition();
     128                c = SwingUtilities.getDeepestComponentAt(c, mouse.x, mouse.y);
     129                topic = contextSensitiveHelp(c);
     130            } else {
     131                Point mouse = Main.parent.getMousePosition();
    127132                topic = contextSensitiveHelp(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y));
    128133            }
     
    143148     */
    144149    private String contextSensitiveHelp(Object c) {
     150        if (c == null)
     151            return null;
    145152        if (c instanceof Helpful)
    146153            return ((Helpful)c).helpTopic();
     
    159166        if (c instanceof Action)
    160167            return (String)((Action)c).getValue("help");
     168        if (c instanceof JComponent && ((JComponent)c).getClientProperty("help") != null)
     169            return (String)((JComponent)c).getClientProperty("help");
    161170        if (c instanceof Component)
    162171            return contextSensitiveHelp(((Component)c).getParent());
Note: See TracChangeset for help on using the changeset viewer.