Skip to main content
Last updated October 25, 2012 09:03, by verhaget
Feedicon  

Dev FAQ Enable help for a module


  • Right-click the module and choose New | Other | Module

Development | JavaHelp Help Set. Click Next.

After you have used the JavaHelp wizard to create the basic structure, you need to create the individual help pages. Each help page is an HTML file. Using the HTML wizard from the directory docs | New | HTML file, create an HTML file named Task.html.

Next, you need to assign this help page to the map file, shown as follows in the overview-map.xml file. As the key under which this help page will be accessed needs to be set in a specific source file, make the key unique by using the fully qualified name of the source file as the name of the key. In this specific context, it will be the fully qualified name of the TaskNode:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map
Version 2.0//EN" "http://java.sun.com/products/javahelp/map_2_0.dtd">
<map version="2.0">
      <mapID target="com.netbeansrcp.overview.about" url="overview-about.html"/>
      <mapID target="com.netbeansrcp.overview.TaskNode" url="Task.html"/>
</map>

Additionally, you need to add the help page to the table of contents file, shown as follows in a file named overview-toc.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC
Version 2.0//EN" "http://java.sun.com/products/javahelp/toc_2_0.dtd">
<toc version="2.0">
      <tocitem text="Overview">
            <tocitem text="About Overview" target="com.netbeansrcp.overview.about"/>
            <tocitem text="Task" target="com.netbeansrcp.overview.TaskNode"/>
      </tocitem>
</toc>

Next, register the help page in the index of the helpset, which is defined as follows in overview-idx.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index
Version 2.0//EN" "http://java.sun.com/products/javahelp/index_2_0.dtd">
<index version="2.0">
      <indexitem text="About Overview" target="com.netbeansrcp.overview.about"/>
      <indexitem text="Task" target="com.netbeansrcp.overview.TaskNode"/>
</index>

For more details see chapter 11: Help of the NetBeans platform 6.9 developers guide.

If you want to change the image of a toc item first register the image in the map file as the following code shows

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 2.0//EN" "http://java.sun.com/products/javahelp/map_2_0.dtd">
<map version="2.0">
    <mapID target="agrosense" url="icon/agrosense.png"/>
</map>

then add an image property to your toc item

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 2.0//EN" "http://java.sun.com/products/javahelp/toc_2_0.dtd">
<toc version="2.0" categoryclosedimage="agrosense" categoryopenimage="agrosense" topicimage="agrosense">
    <tocitem image="agrosense" text="About AgroSense" target="nl.cloudfarming.client.branding.about"/>
</toc>

You could have noticed the categoryclosedimage="agrosense" categoryopenimage="agrosense" topicimage="agrosense" in the toc element. However this does not seem to work.

Merging helpfiles in TOC

It's possible to merge a page into the table of contents of a different module. The following only works when the item you want to merge into doesn't have a page linked to the rootnode! Take a look at the 3d link, or look at Sensor-api and Sensor-greenseeker, Sensor-cropcircle or Sensor-fritzmeier.

Links

 # http://docs.oracle.com/cd/E19253-01/819-0913/author/merge.html
 # http://docs.oracle.com/cd/E19253-01/819-0913/author/toc.html
 # http://wiki.netbeans.org/HelpGuidelines#How_do_I_merge_into_an_existing_TOC_and_index_category.3F
 
 
Close
loading
Please Confirm
Close