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

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r119 r155  
    1313import org.openstreetmap.josm.Main;
    1414import org.openstreetmap.josm.actions.JosmAction;
     15import org.openstreetmap.josm.actions.HelpAction.Helpful;
    1516
    1617/**
    1718 * This class is a toggle dialog that can be turned on and off. It is attached
    1819 * to a ButtonModel.
    19  * 
     20 *
    2021 * @author imi
    2122 */
    22 public class ToggleDialog extends JPanel {
     23public class ToggleDialog extends JPanel implements Helpful {
    2324
    2425        public final class ToggleDialogAction extends JosmAction {
     
    4950                setPreferredSize(new Dimension(330,preferredHeight));
    5051                action = new ToggleDialogAction(name, "dialogs/"+iconName, tooltip, shortCut, KeyEvent.ALT_MASK, iconName);
     52                String helpId = "Dialog/"+getClass().getName().substring(getClass().getName().lastIndexOf('.')+1);
     53                action.putValue("help", helpId.substring(0, helpId.length()-6));
    5154                setLayout(new BorderLayout());
    5255                add(new JLabel(name), BorderLayout.NORTH);
     
    5457                setBorder(BorderFactory.createEtchedBorder());
    5558        }
     59
     60        public String helpTopic() {
     61                String help = getClass().getName();
     62                help = help.substring(help.lastIndexOf('.')+1, help.length()-6);
     63            return "Dialog/"+help;
     64    }
    5665}
Note: See TracChangeset for help on using the changeset viewer.