Create ID Template In Eclipse

Generate an attractive Javadoc format for your Indentification Template.

Insert the ID Template at the top of every class file that contains the method, public static void main(String[] args) { ... }

/** =========================================================================
 * Class:    TwoStudents                                        Exercise 20.2
 * Package:  studentRecords              Date of This Revision:  Nov 20, 2007
 * Author:   Student Stupendous                      ID Number:  123456789
 *
 * Purpose:  Gets and prints the names and GPAs of two students.
 *
 * Course:   Computer Science 201                     Teacher:  Mr. Donaldson
 * Textbook: Horstmann, Cay.  BIG JAVA 2nd Ed. John Wiley & Sons, Inc.  2006.
 * School:   Sir Winston Churchill High School, Calgary, Alberta, Canada
 * Language: Java J2SE 6.0      Target Operating System: Java Virtual Machine
 * System:   Intel Celeron 3GHz running under Windows XP     IDE: Eclipse 3.2
 * ========================================================================*/

Launch Eclipse and following the directions below.

You should now have a document that looks something like the following.

/** =========================================================================
 * Class:    ${primary_type_name}                               Exercise 20.2
 * Package:  ${enclosing_package}             Date of This Revision:  ${date}
 * Author:   Student Stupendous                           ID Number:  ${user}
 *
 * Purpose:
 *
 * Course:   Computer Science 201                     Teacher:  Mr. Donaldson
 * School:   Sir Winston Churchill High School, Calgary, Alberta, Canada
 * Language: Java J2SE 6.0      Target Operating System: Java Virtual Machine
 * System:   Intel Celeron 3GHz running under Windows XP     IDE: Eclipse 3.2
 * ========================================================================*/

Hereafter, when in your Java editor, whenever you want to automatically generate your template, type the name of your template on a blank line (Example: gdid) and simultaneously press the keys <Ctrl> <Space Bar>.

All that remains is to adjust the spacing and insert the purpose and correct Exercise number.


URL:   http://www.comscigate.com/    Last Revised:  November 20, 2007