PreviousNext

Create a macro to generate API documentation

Use a BlackBerry® IDE macro to add comments to code.

Once enabled, if you type /** on any line preceding a function declaration, the BlackBerry IDE generates the following comment:

/**

* <description>.

* @param menu <description>.

* @param instance <description>.

* @return <description>.

*/

If you type /** on any other line, the BlackBerry IDE generates the following comment:

/**

* <description>.

*/

The BlackBerry IDE also preloads "<description>" as your search string, searches for the first instance, and selects that instance. This feature enables you to type a description, and then press F3 to move to subsequent parameters.

Because the API documentation macro relies on parsing the browsing information, add javadocs only after you perform a successful build. If your file contains a syntax error above where you are trying to insert comments, the macro does not retrieve the function declaration.

    1. On the Edit menu, click Preferences.
    2. On the Editor tab, click Macros.
    3. In the When I type drop-down list, click /**.
    4. In the Replace it with textbox, type @javadoc.
    5. Type /** on the same line or the line immediately preceding each function declaration.

      Note: Javadoc™ generation relies on parsing the browsing information. If a syntax error occurs above the location where you are trying to insert javadocs, the macro will not pick up the function declaration. Add Javadocs after doing a successful build.

Related topic


   BlackBerry