Return to index

Help and Documentation

 

While running TJI, there is help on usage in the form of this HTML based User's Guide. The IDE can also display the Java APIs in a number of ways and can automatically document your own projects with a hyperlinked set of HTML files.

 

The Java API Documentation

If you have installed the Java API documentation in the standard location, it should be found automatically and work straight away without you needing to set the documentation path.

However, if you need to set the API documentation path within the IDE, simply enter the directory path to the documentation, as far as, and including, the 'api' directory; you can do this from the 'Set Defaults' sub-menu of the 'Options' menu. For example,

C:/sdk1.6.2/docs/api

If you did not install/download the Java API documentation at the time of installing the SDK/JDK, it can be downloaded from http://java.sun.com

 

The 'Java Guru'

The Java Guru provides a fast and versatile way to query the Java APIs. It provides information on the methods and constructors for Java classes and interfaces, including inherited methods, all alphabetically arranged. It will be found very useful for checking available methods, their parameters, return types, any exceptions that may be thrown and in which class or interface the method is defined.

The Java Guru shows all the available public methods for a given Java class or interface, including those inherited through the class hierarchy up to the 'root' or 'base' class 'Object'. You can simply open Java Guru, type in the name of the class or interface that you are interested in and then either click on the 'Search' button or press the 'Enter' key.

Or you can select a class or interface from the full list of classes and interfaces in Java 1.6 shown on the left of the frame, using the left mouse button. The package of each class and interface is also shown. Interfaces are shown in blue.

When you select a class or interface from this list, or a searched for class or interface is found in this list, the relevant class modifiers (public, static, abstract etc.) are shown in black below the list.

If the caret within the current editor is resting on a recognised class (or instance identifier), this class will be shown when the Java Guru tab is selected.

You can sort and resort the API table as desired by clicking on any column header; a second click reverses the sort direction. You can also change the column widths if required by dragging the column header dividers using the mouse.

If you click on a method in Java Guru, you will be shown a description of that method.

Descriptions of classes and methods are also shown and often provide useful information on using the API.

Method details plus Class and Package descriptions are extracted from the HTML documentation - locally if you have it installed or from the web if you are online.

You can also search for example code use and even create a TJI project from the example if it is a complete program.

 

Pop Up Class and Method Descriptions

While editing you can request a decsription for the class or method indicated by the current caret position within your code. These options are available either via the context menu invoked by a right button mouse click on the editor, or via the 'Class' menu. TJI can usually determine the class type for instance identifiers.

In the case of a method, all the methods with the same name, but different parameters (if this is the case), are shown for comparison.

You can also invoke a method description from the 'code completion' method list by clicking on a method in that list with the right mouse button.

You can close a pop up description by pressing the 'Esc' (Escape) key.

 

Automatic Project Documentation

Javadoc is a standard SDK tool that parses the declarations and documentation comments in a set of class files and produces a set of HTML pages describing the classes, inner classes, interfaces, constructors, methods, and fields.

TJI provides similar functionality that is very much faster and an output that is somewhat simplified and more suited to most developers.

Open any of your own projects, then open or select the 'Doc.s' tab and you will see that it will document your project in a similar format to the standard Java APIs documentation.

You can add detail to this documentation by inserting special comments in your source code.

Any /** blah */ style comment will be used as a description of the class or method that follows it.

JavaDoc comments are distinguished from standard /* blah */ comments by the double asterisk at the start.

You can include special documentation comments in your source code, ahead of declarations for any entity (classes, interfaces, methods, constructors or fields). These are also known as JavaDoc Comments (or simply 'Doc Comments'). A JavaDoc comment consists of the text between the characters '/**' that begin the comment and the characters '*/' that end it. The text can be on multiple lines.

/**
 * This is the format of a simple documentation comment.
 */ 

To save space you can put a comment on one line:

/** This comment takes up only one line. */ 

Note that documentation comments will be recognized only when placed immediately before class, interface, constructor, method or field declarations.

Note that, at present, TJI's documentation functionality does not recognise JavaDoc comments for fields - only methods, inner classes and the class or interface as a whole (in this case, the JavaDoc comment can be placed anywhere before the line that declares the class/interface).

A comment is a description optionally followed by special JavaDoc 'tags' that begin with the '@' character. Here is an example, using an @see tag:

/**
 * This is a doc comment.
 * @see java.lang.Object
 */ 

Although TJI's documentation functionality does not process these tags in any special way, but simply includes them 'as is', this is still a good style to follow.

HTML tags can be included within JavaDoc comments, as shown in the next example:

/**

* Finds the nearest point to the given location.

*

* @param x The present location, <i>horizontally</i>

* @param y The present location, <i>vertically</i>

*

* @return java.awt.Dimension

*/

public Dimension getNearestPoint(int x, int y) {

...

}


Here are some of the standard tags that you can use :

Tag Introduced in SDK
@author 1.0
@deprecated 1.0
@exception 1.0
@param 1.0
@return 1.0
@see 1.0
@since 1.1
@throws 1.2
@version 1.0

 

Return to index