/** * Enables help for a MenuItem. This method sets a * component's helpID and HelpSet. * * @param comp the MenuItem to set the id and hs on. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet */ public void enableHelp(MenuItem comp, String id, HelpSet hs) { if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } }
/** * Enables help for a Component. This method sets a * component's helpID and HelpSet. * * @param comp the Component to set the id and hs on. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet */ public void enableHelp(Component comp, String id, HelpSet hs) { if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } }
/** * Enables help for a MenuItem. This method sets a * Component's helpID and HelpSet and adds an ActionListener. * When an action is performed * it displays the Component's helpID and HelpSet in the default viewer. * * @param comp the MenuItem to set the id and hs on. If comp is null * an IllegalAgrumentException is thrown. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet * @see java.awt.MenuItem * @throws IllegalArgumentException if comp is null. */ public void enableHelpOnButton(MenuItem comp, String id, HelpSet hs) { if (comp == null) { throw new IllegalArgumentException("Invalid Component"); } if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } comp.addActionListener(getDisplayHelpFromSource()); }
CSH.setHelpSet(comp, hs);
CSH.setHelpSet(comp, hs);
CSH.setHelpIDString((Component)obj, id); if (hs != null) { CSH.setHelpSet((Component)obj, hs); CSH.setHelpSet((MenuItem)obj, hs);