blob: e94b0e487d573f4e4edae45a5cd6fd95b1aab374 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>Editor Options: Formatting</title>
<link rel="stylesheet" href="ide.css" title="Oracle BLAFDoc" type="text/css"/>
</head>
<body>
<p><a id="netbeans.optionsDialog.editor.identation" name="netbeans.optionsDialog.editor.identation"></a></p>
<div id="NBCSH130"><!-- infolevel="all" infotype="General" --><a id="sthref6" name="sthref6"></a>
<h1>Editor Options: Formatting</h1>
<a name="BEGIN" id="BEGIN"></a>
<p>This tab enables you to define the formatting style you want to apply to your source files in the editor. The settings in this panel apply globally. Some options apply to all languages while others are language-specific.
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG2297">
<param name="text" value="<html><u>More</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<p>This panel has the following elements.</p>
<table summary="User interface elements and descriptions" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<col width="24%" />
<col width="*" />
<thead>
<tr align="left" valign="top">
<th align="left" valign="bottom" id="r1c1-t5">Element</th>
<th align="left" valign="bottom" id="r1c2-t5">Description</th>
</tr>
</thead>
<tbody>
<tr align="left" valign="top">
<td align="left" id="r2c1-t5" headers="r1c1-t5">
<p>Language</p>
</td>
<td align="left" headers="r2c1-t5 r1c2-t5">Select a language from the dropdown list modify the formatting settings for the selected language. The languages that are available in the dropdown list will depend upon the languages that are enabled in your IDE installation.
<p>All Languages refers to all languages except C++.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r3c1-t5" headers="r1c1-t5">
<p>Category</p>
</td>
<td align="left" headers="r3c1-t5 r1c2-t5">Select a category from the dropdown list. If you selected All Languages, the only Category of options is Tabs and Indents.
<p>The categories that are available in the dropdown list depend upon the language that is selected.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r4c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Tabs and Indents</p>
</td>
<td align="left" headers="r4c1-t5 r1c2-t5">Select this category to specify the values for tabs and indentations in the editor.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r5c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use All Languages Settings</p>
</td>
<td align="left" headers="r5c1-t5 r1c2-t5">When selected the source editor uses the values for tabs and spaces that are specified for All Languages.
<p>This option is only available when a specific language is selected.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r6c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Expand Tabs to Spaces</p>
</td>
<td align="left" headers="r6c1-t5 r1c2-t5">When selected, inserts spaces when the Tab key is typed. When unselected, typing the Tab key inserts the tab character (\t) into the file if possible. It also replaces preceding spaces with the tab character if possible. The Source Editor calculates where to place tab characters based on the value of the Tab Size property.
<p>If Expand Tabs to Spaces is unselected and the Number of Spaces per Indent is different than the Tab Size property, the indentation created by typing the Tab key is made up of a combination of spaces and tab characters. It is easiest to predict the location of tab characters if you set Number of Spaces per Indent to an even multiple or divisor of Tab Size.</p>
<p>Important: This feature does not convert existing tabs to spaces. Only tabs that you add after you enable this option are converted.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r7c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of Spaces per Indent</p>
</td>
<td align="left" headers="r7c1-t5 r1c2-t5">Number of spaces per indentation level for sub-elements, new lines inside brackets, etc.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r8c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tab size</p>
</td>
<td align="left" headers="r8c1-t5 r1c2-t5">See the description of Expand Tabs to Spaces, above.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r9c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Right Margin</p>
</td>
<td align="left" headers="r9c1-t5 r1c2-t5">Specifies the position of the vertical red line that indicates the right margin. The default is 80 characters.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r10c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line Wrap</p>
</td>
<td align="left" headers="r10c1-t5 r1c2-t5">Whether lines are wrapped when they are longer than the width of the Editor window (no relationship to right margin). You can select from the following options.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r11c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Off</p>
</td>
<td align="left" headers="r11c1-t5 r1c2-t5">No line wrapping (default).</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r12c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After words</p>
</td>
<td align="left" headers="r12c1-t5 r1c2-t5">Words are not broken by line wrapping.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r13c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Anywhere</p>
</td>
<td align="left" headers="r13c1-t5 r1c2-t5">Lines are broken in the middle of words by line wrapping.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r14c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Alignment</p>
</td>
<td align="left" headers="r14c1-t5 r1c2-t5">Select this category to specify which elements should be aligned after a line break.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r15c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;New Lines</p>
</td>
<td align="left" headers="r15c1-t5 r1c2-t5">The IDE breaks lines before any elements you select here.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r16c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Group Multiline Alignment</p>
</td>
<td align="left" headers="r16c1-t5 r1c2-t5">Aligns the selected character horizontally across all lines in a group. A group is defined as a number of lines that contain the same type of assignments. The group can be terminated by an empty line, a line with only a comment, a different expression, or the end of a block.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r17c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assignment</p>
</td>
<td align="left" headers="r17c1-t5 r1c2-t5">Affects position of the equal sign character = in a group of lines with assignments. When you set this to 'on', the assignment char '=' is aligned after the longest identifier in a group. This formatting option works for variable assignments, field initializations, and constants.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r18c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Array Initializer</p>
</td>
<td align="left" headers="r18c1-t5 r1c2-t5">Affects position of the initializer characters =&gt; in a group of lines.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r19c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Multiline Alignment</p>
</td>
<td align="left" headers="r19c1-t5 r1c2-t5">Use if you set lines to wrap automatically at an element and you want that element to be aligned vertically.
<p>Requires that <b>wrapping</b> is enabled for the element before you select the element in this dialog.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r20c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Braces</p>
</td>
<td align="left" headers="r20c1-t5 r1c2-t5">Select where to place the braces for each type of statement listed in this dialog. Use the Format function (Alt+Shift+F) to apply the Braces settings to a PHP document.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r21c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Blank Lines</p>
</td>
<td align="left" headers="r21c1-t5 r1c2-t5">Improves readability by setting off sections of code that are logically related according to the specified options. Select the number of blank lines to place in the listed positions.
<p>In the PHP editor, you also have the option to Group Fields Without PHP Doc. This is selected by default. When you select this option, there are no blank lines between fields that do not have PHPDoc documentation.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r22c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Spaces</p>
</td>
<td align="left" headers="r22c1-t5 r1c2-t5">In this panel, set where the IDE automatically puts whitespaces. Due to the large number of possible places to put whitespaces, the places to put whitespaces are displayed in a tree of categories. Expand a tree node to see the places under a category, or collapse a node to hide the places under a category.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r23c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Wrapping</p>
</td>
<td align="left" headers="r23c1-t5 r1c2-t5">In this panel set the rules for the IDE to wrap lines automatically. The panel lists the possible elements before which the IDE wraps lines. For each element you can have the IDE never wrap lines, always wrap lines, or wrap lines if the statement is long (wider than the Editor window).
<p>You can also have the IDE automatically wrap lines after opening and before closing block braces, and between statements that are typed on the same line. Both of these options are enabled by default.</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r24c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Comments</p>
</td>
<td align="left" headers="r24c1-t5 r1c2-t5">In this panel you can specify formatting options for general code comments and Javadoc</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r25c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enable Comments Formatting</p>
</td>
<td align="left" headers="r25c1-t5 r1c2-t5">When selected you can select specific formatting style options for implementing general code and Javadoc comments.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r26c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Imports</p>
</td>
<td align="left" headers="r26c1-t5 r1c2-t5">Use this panel to specify options that control the formatting of import statements that are generated by the IDE.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r27c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use Single Class Imports</p>
</td>
<td align="left" headers="r27c1-t5 r1c2-t5">Select to import only a particular class from a package during import optimization and code generation.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r28c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Import Inner Classes</p>
</td>
<td align="left" headers="r28c1-t5 r1c2-t5">When selected, the IDE creates imports for the inner classes referenced in your code.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r29c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class Count to Use Star Import</p>
</td>
<td align="left" headers="r29c1-t5 r1c2-t5">Number of classes to be imported from a single package until all statements importing a single class are substituted with a statement importing an entire package.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r30c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Members Count To Use Static Star Import</p>
</td>
<td align="left" headers="r30c1-t5 r1c2-t5">Number of static import statements that are allowed for static members of the same type before type is used.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r31c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Packages To Use Star Import</p>
</td>
<td align="left" headers="r31c1-t5 r1c2-t5">Specify a list of packages to be imported completely. Click Add to specify the package name or Remove to delete the currently selected entry from the list.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r32c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use Package Imports</p>
</td>
<td align="left" headers="r32c1-t5 r1c2-t5">Select to import packages during import optimization and code generation.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r33c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use Fully Qualified Names</p>
</td>
<td align="left" headers="r33c1-t5 r1c2-t5">Select to use the fully qualified name of the class during import optimization and code generation.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r34c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Import Layout</p>
</td>
<td align="left" headers="r34c1-t5 r1c2-t5">Specify how import statements should be organized in your code.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r35c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Separate Static Imports</p>
</td>
<td align="left" headers="r35c1-t5 r1c2-t5">When selected, static imports are kept in a separate section. Click Add to add a package name to the list. Click Move Up and Move Down to position certain entries first, or last, or one after another in the list. Click Remove to delete the currently selected entry from the list.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r36c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Separate Groups</p>
</td>
<td align="left" headers="r36c1-t5 r1c2-t5">When selected, imported classes are grouped as per their packages and sorted alphabetically within a package.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r37c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Naming</p>
</td>
<td align="left" headers="r37c1-t5 r1c2-t5">Use this panel to specify the prefixes and suffixes that are used in refactoring, code generation and code completion for fields, parameters and local variables.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r38c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;Ordering</p>
</td>
<td align="left" headers="r38c1-t5 r1c2-t5">In this panel you can set the rules that control the order in which members in a file are displayed in the editor. The Preview pane enables you to view how the members are displayed based on the sort order.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r39c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Members Sort Order</p>
</td>
<td align="left" headers="r39c1-t5 r1c2-t5">Define the order in which the IDE inserts the generated code elements. Use the Move Up and Move Down buttons to place the elements in the desired order.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r40c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sort Members by Visibility</p>
</td>
<td align="left" headers="r40c1-t5 r1c2-t5">When selected, the IDE sorts generated class members by the visibility modifier. Use the Move Up and Move Down buttons to place the following elements in the desired order.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r41c1-t5" headers="r1c1-t5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Keep Getters and Setters Together</td>
<td align="left" headers="r41c1-t5 r1c2-t5">When selected, the getter and setter methods are grouped in pairs.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r42c1-t5" headers="r1c1-t5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sort Members in Groups Alphabetically</td>
<td align="left" headers="r42c1-t5 r1c2-t5">When selected, the members of a group are listed in alphabetical order.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r43c1-t5" headers="r1c1-t5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sort uses dependencies</td>
<td align="left" headers="r43c1-t5 r1c2-t5">Is automatically selected when Sort Members by Visibility is chosen. When selected, dependencies between fields and initializers are respected to prevent compile errors and semantic changes.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r44c1-t5" headers="r1c1-t5">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Insertion Point</p>
</td>
<td align="left" headers="r44c1-t5 r1c2-t5">Use the dropdown list to select where the generated elements are placed in the code.</td>
</tr>
</tbody>
</table>
<br />
<!-- -->
<p>The Preview pane displays how the applied changes will appear in the Source Editor.</p>
<a id="NBCSH171" name="NBCSH171"></a>
<hr><p><b>Related Topics</b></p>
<p><i>Developing Applications with NetBeans IDE</i>,
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG117">
<param name="text" value="<html><u>&quot;Working with the Options Window&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<!-- -->
<!-- Start Footer -->
<table summary="" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" width="86%"><a href="legal_notice.htm">
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.</a>
</td>
</tr>
</table>
<!-- -->
</body>
</html>