?? indentation.html
字號:
Specifies the number of spaces to insert between trailing comments and thepreceding statement.</p><div class="example"><a name="ex-indentation-three-trailing"></a><p class="title"><b>Example 4.41. 3 space trailing comment indent</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">new String[] { "Sunday",-->// Sunday "Monday",-->// Monday "Tuesday",-->// Tuesday "Wednesday",-->// Wednesday "Thursday",-->// Thursday "Friday",-->// Friday "Saturday"-->// Saturday}</pre></td></tr></table></div><p></p></li><li><p><a name="indentation-sizes-tab"></a>Original Tab indent</p><p>Specifies the original tabular size of the source code. Some indentationsor alignments may fail, if you miss the correct size here.<a class="indexterm" name="d0e2282"></a><a class="indexterm" name="d0e2288"></a></p></li><li><p><a name="indentation-sizes-extends"></a>Extends indent</p><p>If enabled, specifies the whitespace to print before the <tt class="classname">extends</tt>keyword in case it was printed on a new line.</p><a class="indexterm" name="d0e2304"></a><div class="example"><a name="d0e2311"></a><p class="title"><b>Example 4.42. extends indentation with 6 spaces</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">public interface Channel------>extends Puttable, Takable{ ...}</pre></td></tr></table></div><p></p></li><li><p><a name="indentation-sizes-implements"></a>Implements indent</p><p>Specifies the whitespace to print before the <tt class="classname">implements</tt>keyword in case it was printed on a new line.</p><a class="indexterm" name="d0e2325"></a><div class="example"><a name="d0e2332"></a><p class="title"><b>Example 4.43. implements indentation with 8 spaces</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">public class SynchronizedBoolean------->implements Comparable, Cloneable{ ...}</pre></td></tr></table></div><p></p></li><li><p><a name="indentation-sizes-throws"></a>Throws indent</p><p>Specifies the whitespace to print before the <tt class="classname">throws</tt>keyword in case it was printed on a new line.<a class="indexterm" name="d0e2346"></a></p><div class="example"><a name="d0e2354"></a><p class="title"><b>Example 4.44. throws indentation with 3 spaces</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">private static final File getDestinationFile(File dest, String packageName, String filename)-->throws IOException, FooException{ ...}</pre></td></tr></table></div><p></p></li></ul></div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="indentation-misc"></a>4.3.3.2. Misc</h4></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p><a name="indentation-misc-tab"></a>Use tabs to indent<a class="indexterm" name="d0e2369"></a></p><p>Normally, Jalopy uses spaces to indent lines. If you prefer tabs, check this box.</p></li><li><p>Indent "case" from "switch"</p><p>The Sun Java code convention recommends a switch style where case statementsare not indented relative to the switch statement as a whole. However, thisoption allows you to indent the case statements to make the entire switchstatement stand out.</p><div class="example"><a name="ex-indentation-misch-switch-un"></a><p class="title"><b>Example 4.45. Switch statement (unindented)</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">switch (prio){case Priority.ERROR_INT :case Priority.FATAL_INT : color = Color.red; break;case Priority.WARN_INT : color = Color.blue; break;default: color = Color.black; break;}</pre></td></tr></table></div><p></p><div class="example"><a name="ex-indentation-misc-switch"></a><p class="title"><b>Example 4.46. Switch statement (indented)</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">switch (prio){--->case Priority.ERROR_INT :--->case Priority.FATAL_INT :---> color = Color.red;---> break;--->case Priority.WARN_INT :---> color = Color.blue;---> break;--->default:---> color = Color.black;---> break;}</pre></td></tr></table></div><p></p></li><li><p><a name="indentation-misc-label"></a>Indent labels<a class="indexterm" name="d0e2397"></a></p><p>Specifies whether lables should be indented with the current indentation level.</p><div class="example"><a name="ex-indentation-misc-label-unindent"></a><p class="title"><b>Example 4.47. Unindented label</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting">// advance to the first CLASS_DEF or INTERFACE_DEF<span class="bold"><b>LOOP</b></span>: for (AST child = tree.getFirstChild(); child != null; child = child.getNextSibling()) { switch (child.getType()) { case JavaTokenTypes.CLASS_DEF : case JavaTokenTypes.INTERFACE_DEF : next = child; break LOOP; default : break; } }</pre></td></tr></table></div><p></p><div class="example"><a name="ex-indentation-misc-label"></a><p class="title"><b>Example 4.48. Indented label</b></p><table border="0" bgcolor="#E0E0E0" class="shade"><tr><td><pre class="programlisting"> // advance to the first CLASS_DEF or INTERFACE_DEF <span class="bold"><b>LOOP</b></span>: for (AST child = tree.getFirstChild(); child != null; child = child.getNextSibling()) { switch (child.getType()) { case JavaTokenTypes.CLASS_DEF : case JavaTokenTypes.INTERFACE_DEF : next = child; break LOOP; default : break; } }</pre></td></tr></table></div><p></p></li><li><p><a name="indentation-misc-first-column"></a>Indent first column comments</p><p>Normally, all comments will be indented relative to their position in the codeto avoid that comments break the logical structure of the program. Somedevelopers may like to disable the indentation for first column comments
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -