| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <title> |
| Code Formatter |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| </head> |
| <body> |
| <h1> |
| Code Formatter |
| </h1> |
| <p> |
| The preview pane on this page demonstrates what each of these options will do to Java code in the editor. |
| </p> |
| <table border="1" cellspacing="0" cellpadding="5"> |
| <caption> |
| Code Formatter Preferences |
| </caption> |
| <thead> |
| <tr> |
| <th> |
| <p> |
| Option |
| </p> |
| </th> |
| <th> |
| <p> |
| Description |
| </p> |
| </th> |
| <th> |
| <p> |
| Default |
| </p> |
| </th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td valign="top"> |
| Insert a new line before an opening brace |
| </td> |
| <td valign="top"> |
| The editor inserts a line break before opening a new brace. In other words, open braces always start at the beginning of a new line. |
| </td> |
| <td valign="top"> |
| Off |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Insert new lines in control statements |
| </td> |
| <td valign="top"> |
| The editor inserts a line break before a new control statement. In other words, control statements (e.g., if, else, catch, finally, etc.) always start at the beginning |
| of a new line. |
| </td> |
| <td valign="top"> |
| Off |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Clear all blank lines |
| </td> |
| <td valign="top"> |
| The editor deletes all blank lines in the file. |
| </td> |
| <td valign="top"> |
| Off |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Insert new line between 'else if' |
| </td> |
| <td valign="top"> |
| The editor inserts a new line between the words "else" and "if" in else-if statements. |
| </td> |
| <td valign="top"> |
| Off |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Insert a new line inside an empty block |
| </td> |
| <td valign="top"> |
| The editor inserts a line break between empty braces. In other words, the left and right braces in an empty braces set will always appear on separate lines. An |
| exception is if the right brace is followed by a keyword, in which case, the two braces appear on the same line. |
| </td> |
| <td valign="top"> |
| On |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Maximum line length |
| </td> |
| <td valign="top"> |
| This is the maximum length of any one line. Lines longer than this number are split and wrapped. Entering 0 here disables line splitting completely. |
| </td> |
| <td valign="top"> |
| 80 |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Compact assignment |
| </td> |
| <td valign="top"> |
| The editor removes any spaces between a variable and an assignment statement so that they are asymmetrical (e.g., <code>a= b;</code>). |
| </td> |
| <td valign="top"> |
| Off |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| Insert a space after a cast |
| </td> |
| <td valign="top"> |
| The editor inserts a space between the cast and the following expression. |
| </td> |
| <td valign="top"> |
| On |
| </td> |
| </tr> |
| |
| <tr> |
| <td valign="top"> |
| Insert tabs for indentation, not spaces |
| </td> |
| <td valign="top"> |
| The editor uses tabs instead of spaces to represent indentations. |
| </td> |
| <td valign="top"> |
| On |
| </td> |
| </tr> |
| |
| <tr> |
| <td valign="top"> |
| Number of spaces representing an indentation level |
| </td> |
| <td valign="top"> |
| If the editor uses spaces instead of tabs to represent indentations, this is the number of spaces that comprises a single indentation. |
| </td> |
| <td valign="top"> |
| 4 |
| </td> |
| </tr> |
| |
| <tr> |
| <td valign="top"> |
| Preview pane |
| </td> |
| <td valign="top"> |
| Shows an example of what your Java code will look like with the settings currently displayed on this page. |
| </td> |
| <td valign="top"> |
| n/a |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <p> |
| <img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159"> |
| </p> |
| <p> |
| <a href="../tasks/tasks-66.htm">Formatting Java code</a><br> |
| </p> |
| <p> |
| <a href="../reference/ref-java-editor.htm">Java editor</a><br> |
| <a href="../reference/ref-21.htm">Java editor preferences</a><br> |
| </p> |
| <a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0" width="324" height="14"></a> |
| </body> |
| </html> |
| |