# java(9)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## SYNOPSIS

java - Java programming language templates

## FILES

hkjava.emf - Java programming language hook definition
java.etf - Java programming language template file

## EXTENSIONS

.java, .jav - Java

## DESCRIPTION

The java file type templates share much with the c(9) template definitions, utilising the electric 'C' features for automatic layout of text.

General Editing

On creating a new file, a new header is automatically included into the file. time(2m) is by default enabled, allowing the modification time-stamp to be maintained in the header.

Hilighting

The hilighting features allow commands, variables, logical, preprocessor definitions, comments, strings and characters of the language to be differentiated and rendered in different colors.

Auto Layout

The C-Mode indent(2) performs automatic layout of the text.

restyle-region(3) and restyle-buffer(3) are available to reformat (re-layout) selected sections of the buffer, or the whole buffer, respectively.

Comments may be formatted using `esc o`, which reformats the comments according to the current fill paragraph. If a comment commences with `/***...` then the comment is automatically formatted to a box.

Folding and Information Hiding

Generic folding is enabled within the Java files. The folds occur about braces {...} located on the left-hand margin. collapse-all(3) (un)folds all regions in the file, collapse-current(3) (un)folds the current region. Note that folding does not operate on K&R style code, with the trailing open brace.

Tags

A c-tags file may be generated within the editor using the Tools -> Java-Tools -> Create Tag File. find-tag(2) takes the user to the file using the tag information.

On invoking the tag generator then the user is presented with a dialog box which specifies the generation option of the tags file. The base directory of the tags file search and tagging options may be specified to locate all of the definitions within the code space.

The tags file is extremely useful where the user is dealing with inherited source code spread over multiple directories. Generation of a recursive tag file with all searching options enabled allows labels to be located extremely rapidly (certainly faster than IDE environments).

Folding and Information Hiding

Generic folding is enabled within the C and C++ files. The folds occur about braces {...} located on the left-hand margin. collapse-all(3) (un)folds all regions in the file, collapse-current(3) (un)folds the current region. Note that folding does not operate on K&R style code.

The Tools -> C-Tools menu allows `#define`'s to be evaluated within the buffer. Where the state of a `#if` is established to be false (using the `#define` information) then the disabled region of code is grayed out indicating which regions of the code are active.

Working Environment

compile(3) may be invoked to rebuild the source, the user is prompted to save any files.

rcs-file(2) is automatically invoked if an RCS file is detected, the normal check-in/out operations may be performed through the editor.

Short Cuts

The short cut keys used within the buffer are:-

C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c C-e - Comment to the end of the line with stars (*).
A-C-i - Restyle the current region.
esc q - Format a comment.
esc o - Format a comment.
f2 - (un)fold the current region
f3 - (un)fold all regions

## NOTES

The hilighting is typically extended using a file myjava.emf

## SEE ALSO

c(9), collapse-all(3), collapse-current(3), compile(3), find-tag(2), find-tag(2), javatags(3f), rcs-file(2), restyle-buffer(3), restyle-region(3), time(2m).

Supported File Types

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>