This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 9cf4fb6 Automated site publishing by Jenkins build 595
9cf4fb6 is described below
commit 9cf4fb637230903a71c566167e1c495ec935373c
Author: jenkins <[email protected]>
AuthorDate: Mon Feb 18 21:31:05 2019 +0000
Automated site publishing by Jenkins build 595
---
content/kb/docs/java/editor-codereference.html | 2200 ++++++++++++++++++++++++
1 file changed, 2200 insertions(+)
diff --git a/content/kb/docs/java/editor-codereference.html
b/content/kb/docs/java/editor-codereference.html
new file mode 100644
index 0000000..d7e1df0
--- /dev/null
+++ b/content/kb/docs/java/editor-codereference.html
@@ -0,0 +1,2200 @@
+
+<!DOCTYPE html>
+<html class="no-js" lang="en" dir="ltr">
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <title>Code Assistance in the NetBeans IDE Java Editor: A Reference
Guide</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="Code Assistance in the NetBeans IDE Java
Editor: A Reference Guide - Apache NetBeans">
+ <meta name="author" content="Apache NetBeans">
+ <meta name="keywords" content="Apache NetBeans, Tutorials, Code
Assistance in the NetBeans IDE Java Editor: A Reference Guide">
+ <meta name="generator" content="Apache NetBeans">
+ <link rel="stylesheet" href="/css/font-awesome.min.css">
+ <link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
+ <link rel="stylesheet" href="/css/netbeans.css">
+ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
+ <link rel="manifest" href="/site.webmanifest">
+ <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
+ <meta name="msapplication-TileColor" content="#ffc40d">
+ <meta name="theme-color" content="#ffffff">
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700"
rel="stylesheet">
+ <!--
+ 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.
+ -->
+</head>
+
+
+ <body>
+
+
+<div class="title-bar" data-responsive-toggle="responsive-menu"
data-hide-for="medium">
+ <button type="button" data-toggle="responsive-menu"><i style='font-size:
32px; color: #fff; padding: 8px' class='fa fa-bars'></i></button>
+ <div class="title-bar-title">Apache NetBeans</div>
+</div>
+<div class="top-bar" id="responsive-menu">
+ <div class='top-bar-left'>
+ <a class='title' href="/"><img src='/images/apache-netbeans.svg'
style='padding: 8px; height: 48px;'></img> Apache NetBeans (incubating)</a>
+ </div>
+ <div class="top-bar-right">
+ <ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
+ <li> <a href="/community/index.html">Community</a> </li>
+ <li> <a href="/participate/index.html">Participate</a> </li>
+ <li> <a href="https://blogs.apache.org/netbeans/">Blog</a></li>
+ <li> <a href="/help/index.html">Get Help</a> </li>
+ <li> <a href="/plugins/index.html">Plugins</a> </li>
+ <li> <a href="/download/nb100/nb100.html">Download</a> </li>
+ </ul>
+ </div>
+</div>
+
+
+
+<!-- src/templates/news -->
+<section class="hero news alternate">
+ <div class='grid-container'>
+ <div class='cell'>
+ <div class="annotation">Just released!</div>
+ <h1 syle='font-size: 2rem'>Apache NetBeans 10.0</h1>
+ <p><a class="button success"
href="/download/nb100/nb100.html">Read more</a></p>
+ </div>
+ </div>
+</section>
+
+ <div class='grid-container main-content tutorial'>
+ <h1 class="sect0">Code Assistance in the NetBeans IDE Java Editor:
A Reference Guide</h1>
+
+ <div class="sectionbody">
+ <div class="paragraph">
+ <p class='reviewed'><i class="fa fa-check-circle"></i> Last
reviewed on 2019-02-17</p>
+ </div>
+ </div>
+
+ <div id="toc" class="toc">
+<div id="toctitle"></div>
+<ul class="sectlevel1">
+<li><a href="#_general_editor_features">General Editor Features</a>
+<ul class="sectlevel2">
+<li><a href="#_code_formatting">Code Formatting</a></li>
+<li><a
href="#_inserting_and_highlighting_braces_brackets_and_quotes">Inserting and
Highlighting Braces, Brackets, and Quotes</a></li>
+<li><a href="#_code_folding">Code Folding</a></li>
+<li><a href="#_customizing_keyboard_shortcuts">Customizing Keyboard
Shortcuts</a></li>
+</ul>
+</li>
+<li><a href="#_smart_code_completion">Smart Code Completion</a>
+<ul class="sectlevel2">
+<li><a href="#_invoking_code_completion">Invoking Code Completion</a></li>
+<li><a href="#_smart_suggestions_at_the_top">Smart Suggestions at the
Top</a></li>
+<li><a href="#_camel_case_completion">Camel Case Completion</a></li>
+<li><a href="#_completing_keywords">Completing Keywords</a></li>
+<li><a href="#_suggesting_names_for_variable_and_fields">Suggesting Names for
Variable and Fields</a></li>
+<li><a href="#_suggesting_parameters">Suggesting Parameters</a></li>
+<li><a href="#_common_prefix_completion">Common Prefix Completion</a></li>
+<li><a href="#_subword_completion">Subword Completion</a></li>
+<li><a href="#_chain_completion">Chain Completion</a></li>
+<li><a href="#_completion_of_static_imports">Completion of Static
Imports</a></li>
+<li><a href="#_excluding_items_from_completion">Excluding Items from
Completion</a></li>
+<li><a href="#_jpa_completion">JPA Completion</a></li>
+</ul>
+</li>
+<li><a href="#_managing_imports">Managing Imports</a></li>
+<li><a href="#_generating_code">Generating Code</a>
+<ul class="sectlevel2">
+<li><a href="#_using_the_code_generation_dialog_box">Using the Code Generation
Dialog Box</a></li>
+<li><a href="#_using_code_completion">Using Code Completion</a></li>
+</ul>
+</li>
+<li><a href="#_code_templates">Code Templates</a>
+<ul class="sectlevel2">
+<li><a href="#_using_code_templates">Using Code Templates</a></li>
+<li><a href="#_adding_or_editing_code_templates">Adding or Editing Code
Templates</a></li>
+</ul>
+</li>
+<li><a href="#_working_with_javadoc">Working with Javadoc</a>
+<ul class="sectlevel2">
+<li><a href="#_displaying_javadoc">Displaying Javadoc</a></li>
+<li><a href="#_creating_javadoc_stubs">Creating Javadoc Stubs</a></li>
+<li><a href="#_using_javadoc_hints">Using Javadoc Hints</a></li>
+<li><a href="#_using_code_completion_for_javadoc_tags">Using Code Completion
for Javadoc Tags</a></li>
+<li><a href="#_generating_javadoc">Generating Javadoc</a></li>
+<li><a href="#_analyzing_javadoc">Analyzing Javadoc</a></li>
+</ul>
+</li>
+<li><a href="#_using_hints">Using Hints</a>
+<ul class="sectlevel2">
+<li><a href="#_using_hints_to_fix_code">Using Hints to Fix Code</a></li>
+<li><a href="#_surround_with">Surround With…​</a></li>
+<li><a href="#_customizing_hints">Customizing Hints</a></li>
+</ul>
+</li>
+<li><a href="#_semantic_coloring_and_highlighting">Semantic Coloring and
Highlighting</a>
+<ul class="sectlevel2">
+<li><a href="#_customizing_colors">Customizing Colors</a></li>
+<li><a href="#_exporting_and_importing_settings">Exporting and Importing
Settings</a></li>
+<li><a href="#_coloring_example">Coloring Example</a></li>
+<li><a href="#_using_highlights">Using Highlights</a></li>
+</ul>
+</li>
+<li><a href="#_navigation">Navigation</a>
+<ul class="sectlevel2">
+<li><a href="#_error_stripes">Error Stripes</a></li>
+<li><a href="#_navigating_from_the_editor_go_to">Navigating From the Editor:
Go to…​</a></li>
+<li><a href="#_jumping_to_last_edit">Jumping to Last Edit</a></li>
+<li><a href="#_using_breadcrumbs">Using Breadcrumbs</a></li>
+<li><a href="#_switching_between_files">Switching Between Files</a></li>
+<li><a href="#_using_bookmarks">Using Bookmarks</a></li>
+<li><a href="#_using_the_navigator">Using the Navigator</a></li>
+</ul>
+</li>
+<li><a href="#_appendix_a_icons_in_the_code_completion_window">Appendix A:
Icons in the Code Completion Window</a></li>
+</ul>
+</div>
+<div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>The purpose of any integrated development environment (IDE) is to maximize
productivity and support seamless development from a single tool. This
reference document describes useful code assistance features, customization
options, and navigation capabilities of the NetBeans IDE’s Java
Editor.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_general_editor_features"><a class="link"
href="#_general_editor_features">General Editor Features</a></h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_code_formatting"><a class="link" href="#_code_formatting">Code
Formatting</a></h3>
+<div class="paragraph">
+<p>Code formatting allows you to set up the editor to layout your source code
in the way that you find most preferable and comfortable to work with. When you
want to format your code simply press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Shift-F</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-F</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Source > Format</strong> from the menu bar or,
right-click and select <strong>Format</strong>. Your code will then be
formatted according to the rules specified in the Formatting pane.</p>
+</div>
+<div class="paragraph">
+<p>To customize the formatting behaviour, open the formatting pane by
selecting:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Formatting</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Formatting</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select <strong>Language: Java</strong>. From the
<strong>Category:</strong> drop-down list, you can select from a wide range of
customizable elements such as: the number of blank lines, the size of tabs and
indentation, wrapping style, etc. You can preview your changes as you make
them.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_inserting_and_highlighting_braces_brackets_and_quotes"><a
class="link"
href="#_inserting_and_highlighting_braces_brackets_and_quotes">Inserting and
Highlighting Braces, Brackets, and Quotes</a></h3>
+<div class="paragraph">
+<p>By default, the editor automatically inserts matching pairs for braces,
brackets, parentheses and, quote marks. When you type an opening brace and then
press <code>Enter</code>, the closing brace is added automatically. However,
for <code>(</code>, <code>[</code>, <code>"</code>, and <code>'</code>, the
editor inserts the matching pair immediately, and positions the cursor between
them.</p>
+</div>
+<div class="paragraph">
+<p>If, for some reason, this feature is disabled, you can enable it by
selecting:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Completion</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Completion</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then in the <strong>Language: All Languages</strong> pane select the
<strong>Insert Closing Brackets Automatically</strong> checkbox.</p>
+</div>
+<div class="paragraph">
+<p>The editor also highlights matching pairs of braces, brackets and
parentheses. If for example, you place the cursor immediately adjacent to any
brace, bracket or parenthesis and, it has a matching pair, both will be
highlighted in yellow. If there is no matching pair, then the single element is
highlighted in red and an error mark is displayed in the left-hand margin.</p>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+Do not take any notice of the indicated error, because it does not propose an
unpaired element and is therefore misleading. The key indicator is the red
highlight.
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>To customize the highlight colors, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Fonts & Colors > Highlighting</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Fonts & Colors >
Highlighting</p>
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_code_folding"><a class="link" href="#_code_folding">Code
Folding</a></h3>
+<div class="paragraph">
+<p>In the editor, you can quickly collapse and expand blocks of code, such as
method declarations, Javadoc comments, import statements, etc. Collapsible
blocks are indicated by a gray line with a minus sign in a box attached to the
top of the line in the left-hand margin of the editor. Expandable blocks are
indicated by a box with a plus sign in the same margin.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/code-folded2a.png" alt="code folded2a">
+</div>
+</div>
+<div class="paragraph">
+<p>The easiest way to collapse a specific block of code is to double-click the
gray line in the left-hand margin, the number of collapsed lines within the
block are then displayed. You can quickly review the collapsed parts of your
code by doing a mouse over the folded elements.</p>
+</div>
+<div class="paragraph">
+<p>More options for collapsing and expanding code blocks can be found by
selecting <strong>View > Code Folds</strong> from the menu bar or,
right-click select <strong>Code Folds</strong>, where you will also find
keyboard shortcuts.</p>
+</div>
+<div class="paragraph">
+<p>To customize the code folding options select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Folding</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Folding</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select <strong>Language : Java</strong>. There you will find various
options.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_customizing_keyboard_shortcuts"><a class="link"
href="#_customizing_keyboard_shortcuts">Customizing Keyboard Shortcuts</a></h3>
+<div class="paragraph">
+<p>To customize keyboard shortcuts, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Keymap</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Keymap</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select <strong>Manage Profiles…​</strong> . Select the
profile you want to use as a base for your new profile and click
<strong>Duplicate</strong>, rename your profile and click <strong>OK</strong>,
then <strong>Close</strong>.</p>
+</div>
+<div class="paragraph">
+<p>Ensure that your new profile is selected, <strong>Profile:
<myNewProfileName></strong> and then you can modify the shortcuts you
need.</p>
+</div>
+<div class="paragraph">
+<p>To edit a shortcut, double-click in the <strong>Shortcut</strong> field or,
click the ellipsis button ( <code>…​</code> ) and select
<strong>Edit…​</strong> As you press a sequence of keys, the syntax
for them is added. If you want to add special keys, such as: <code>Tab</code>
, <code>Escape</code> or, <code>Enter</code> etc., click the ellipsis button
( <code>…​</code> ) again and select the key from the pop-up
window. When you have finished ed [...]
+</div>
+<div class="paragraph">
+<p>You can save customized sets of your shortcuts as profiles. Then, you can
switch from one profile to another to quickly change multiple settings.</p>
+</div>
+<div class="paragraph">
+<p>To find a shortcut for a specific command, type the command name in the
Search field.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_smart_code_completion"><a class="link"
href="#_smart_code_completion">Smart Code Completion</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The editor helps you quickly complete or generate code through the "smart"
code completion feature. Code completion is very useful when you want to fill
in missing code, it allows you to look at the available options within the
context of your application, and generates fragments of code when required. See
below for examples of how to use code completion.</p>
+</div>
+<div class="sect2">
+<h3 id="_invoking_code_completion"><a class="link"
href="#_invoking_code_completion">Invoking Code Completion</a></h3>
+<div class="paragraph">
+<p>To invoke code completion press <code>Ctrl-Space</code> or, choose
<strong>Source > Complete Code…​</strong> from the menu bar and
a list of appropriate suggestions is presented to you. As you continue to type,
code completion becomes more focussed and the list shortens. The list includes
options imported in your source file and symbols from the
<code>java.lang</code> package.</p>
+</div>
+<div class="paragraph">
+<p>To customize the code completion settings, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong> ™
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Completion</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong> ™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Completion</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>You can set code completion to pop-up an options list either automatically
or, on an as-needed basis. In the Code Completion pane for <strong>Language:
All Languages</strong>, select the <strong>Auto Popup Completion
Window</strong> checkbox to invoke code completion automatically when you type
certain characters. The default character for <strong>Language: Java</strong>
is " <code>.</code> ", but you can add your own characters.</p>
+</div>
+<div class="paragraph">
+<p>To add characters that will invoke code completion, select the
<strong>Language: Java</strong> pane and type your characters in the
<strong>Auto Popup Triggers for Java:</strong> field. The code completion list
will pop-up every time you type one of your specified characters, simply select
your desired option, hit return or "double-click", for it to be entered into
your document.</p>
+</div>
+<div class="paragraph">
+<p>When the <strong>Auto Popup Completion Window</strong> checkbox is not
selected, you need to press <code>Ctrl-Space</code> each time you want to
invoke code completion.</p>
+</div>
+<div class="paragraph">
+<p>Instead of using <code>Ctrl-Space</code> for code completion, you can use
"hippie completion". Hippie completion analyzes text in the visible scope by
searching your current document and, if not found, in other documents. Hippie
completion then provides suggestions to complete the current word with a
keyword, class name, method, or variable. To invoke hippie completion press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-K</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-K</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>and the editor automatically completes the word you’re typing.
Repeatedly pressing the appropriate key combination will cycle once through all
available options. If you go past your desired option then press the shift key
as well as your key combination and you can reverse.</p>
+</div>
+<div class="paragraph">
+<p>The first time <code>Ctrl-Space</code> is pressed only items matching the
type, in this example an <code>int</code>, are shown.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/codecompletion3.png" alt="codecompletion3">
+</div>
+</div>
+<div class="paragraph">
+<p>Press <code>Ctrl-Space</code> a second time and <em>all</em> available
items are shown, regardless of whether they match the provided type, as shown
below.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/codecompletion4.png" alt="codecompletion4">
+</div>
+</div>
+<div class="paragraph">
+<p>Also, you can select for <strong>Language: Java</strong> the <strong>Auto
Popup on Typing Any Java Identifier Part</strong> checkbox and, as you type
keywords etc., code completion automatically presents you with an appropriate
list of options.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_smart_suggestions_at_the_top"><a class="link"
href="#_smart_suggestions_at_the_top">Smart Suggestions at the Top</a></h3>
+<div class="paragraph">
+<p>Code completion is "smart", and will present the most relevant suggestions
at the top, above the black line in the code completion list.</p>
+</div>
+<div class="paragraph">
+<p>In the example below, the editor suggests inserting the
<code>LinkedHashMap</code> constructor from the <code>java.util</code>
package.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/smartcompletion1.png" alt="smartcompletion1">
+</div>
+</div>
+<div class="paragraph">
+<p>If the "smart" suggestions are not the ones you want to use, press
<code>Ctrl-Space</code> again to see the complete list.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_camel_case_completion"><a class="link"
href="#_camel_case_completion">Camel Case Completion</a></h3>
+<div class="paragraph">
+<p>Instead of typing consecutive characters, and then calling code completion,
you can type the initial capital letters of the word you’re interested
in.</p>
+</div>
+<div class="paragraph">
+<p>For example, type <code>IE</code> , press <code>Ctrl-Space</code> , and
you will see a list of suggestions that match via camel case completion using
the letter <code>I</code> and then the letter <code>E</code> .</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/camelcase.png" alt="camelcase">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_completing_keywords"><a class="link"
href="#_completing_keywords">Completing Keywords</a></h3>
+<div class="paragraph">
+<p>Use code completion to complete keywords in your code. The editor analyzes
the context and suggests the most relevant keywords.</p>
+</div>
+<div class="paragraph">
+<p>In the example below, the <code>ColorChooser</code> class needs to extend
the <code>JPanel</code> class. You can quickly add the keyword
<code>extends</code> from the suggested items.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/keywords.png" alt="keywords">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_suggesting_names_for_variable_and_fields"><a class="link"
href="#_suggesting_names_for_variable_and_fields">Suggesting Names for Variable
and Fields</a></h3>
+<div class="paragraph">
+<p>When you are adding a new field or a variable, use code completion to
choose a name that matches its type.</p>
+</div>
+<div class="paragraph">
+<p>Type a prefix for the new name, press <code>Ctrl-Space</code> and select
the name you want to use from the list of suggestions.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/names.png" alt="names">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_suggesting_parameters"><a class="link"
href="#_suggesting_parameters">Suggesting Parameters</a></h3>
+<div class="paragraph">
+<p>The editor determines the most likely parameters for variables, methods, or
fields and displays the suggestions in a pop-up box.</p>
+</div>
+<div class="paragraph">
+<p>For example, when you select a method from the code completion window which
has one or more arguments, the editor highlights the first argument and
displays a tooltip suggesting the format for this argument. To move to the next
argument, press the <code>Tab</code> or <code>Enter</code> keys.</p>
+</div>
+<div class="paragraph">
+<p>You can invoke the tooltips with method parameters by pressing:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-P</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-P</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, selecting <strong>Source > Show Method Parameters</strong> from the
menu bar at any time.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/parameter.png" alt="parameter">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_common_prefix_completion"><a class="link"
href="#_common_prefix_completion">Common Prefix Completion</a></h3>
+<div class="paragraph">
+<p>You can use the <code>Tab</code> key to quickly fill in the most commonly
used prefixes and single suggestions. To check out how this feature works, try
typing the following:</p>
+</div>
+<div class="paragraph">
+<p>Type <code>System.out.p</code> and wait for code completion to show all
fields and methods that start with "p". All the suggestions will be related to
"print".</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/prefixcompletion.png" alt="prefixcompletion">
+</div>
+</div>
+<div class="paragraph">
+<p>Press the <code>Tab</code> key and the editor automatically fills in the
"print". You can continue and type "l" and, after pressing <code>Tab</code>
again, "println" will be added.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_subword_completion"><a class="link"
href="#_subword_completion">Subword Completion</a></h3>
+<div class="paragraph">
+<p>Sometimes you may not remember how an item starts, making it difficult to
use code completion. For example, to see all items that relate to listening to
property changes, you can use subword completion, so if you type
<code>prop</code> you will see all method calls that relate to property change
listening.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/subcompletion.png" alt="subcompletion">
+</div>
+</div>
+<div class="paragraph">
+<p>To implement this feature, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Completion</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Completion</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select in the <strong>Language: Java</strong> pane, the
<strong>Subword completion</strong> checkbox.</p>
+</div>
+<div class="paragraph">
+<p>You can then type part of the method you want to call, in this case
<code>prop</code>, then invoke code completion, relevant alternatives all
applicable to properties on the object, in this example, are displayed.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_chain_completion"><a class="link" href="#_chain_completion">Chain
Completion</a></h3>
+<div class="paragraph">
+<p>When you need to type a chain of commands, you can use code completion. By
pressing <code>Ctrl-Space</code> twice all available chains will be shown.
The editor scans: variables, fields, and methods that are in the visible
context. It will then suggest a chain that satisfies the expected type.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/chain.png" alt="chain">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_completion_of_static_imports"><a class="link"
href="#_completion_of_static_imports">Completion of Static Imports</a></h3>
+<div class="paragraph">
+<p>When you want to complete a statement and, at the same time, require to
make use of a static import statement, use code completion. By pressing
<code>Ctrl-Space</code> twice, all available static import statements will be
shown.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/static.png" alt="static">
+</div>
+</div>
+<div class="paragraph">
+<p>If you would like static import statements to be added automatically,
select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Formatting</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Formatting</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then from the <strong>Language: Java</strong>, <strong>Category:
Imports</strong> pane select the <strong>Prefer Static Imports</strong>
checkbox.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_excluding_items_from_completion"><a class="link"
href="#_excluding_items_from_completion">Excluding Items from
Completion</a></h3>
+<div class="paragraph">
+<p>Time can be wasted when code completion returns classes that you seldom or
never use. When you invoke code completion, a lightbulb within the returned
items indicates that you can exclude them from the code completion list.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/exclude2-small.png" alt="exclude2 small">
+</div>
+</div>
+<div class="paragraph">
+<p>You can add or modify your exclusion rules either when "Configure excludes"
is selected from the code completion list or, by selecting:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Completion</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Completion</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then in the <strong>Language: Java</strong> pane, make your changes to the
<strong>Packages/classes:</strong> list.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/exclude.png" alt="exclude">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_jpa_completion"><a class="link" href="#_jpa_completion">JPA
Completion</a></h3>
+<div class="paragraph">
+<p>When you are using the Java Persistence Annotation specification (JPA), you
can complete SQL expressions in <code>@NamedQuery</code> statements via code
completion.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/jpacompletion.png" alt="jpacompletion">
+</div>
+</div>
+<div class="paragraph">
+<p>In the code completion window, icons are used to distinguish different
members of the Java language. See <a href="#appendixa">Appendix A: Icons in the
Code Completion Window</a> at the end of this document to see the meanings of
these icons.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_managing_imports"><a class="link" href="#_managing_imports">Managing
Imports</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>There are several ways of working with import statements. The editor
constantly checks your code for the correct use of import statements and
immediately warns you when non-imported classes or unused import statements are
detected.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/imports3.png" alt="imports3">
+</div>
+</div>
+<div class="paragraph">
+<p>When a non-imported class is found, the <span class="image"><img
src="images/bulberror1.png" alt="bulberror1"></span> error mark appears in the
IDE’s left-hand margin (also called the <em>glyph margin</em>). Click the
error mark and choose whether to: add the missing import, create this class in
the current package or, create this class in the current class.</p>
+</div>
+<div class="paragraph">
+<p>While you are typing, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-I</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-I</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, choose <strong>Source > Fix Imports</strong> from the menu bar or,
right-click and choose <strong>Source > Fix Imports</strong>, to add all
missing import statements and, remove all unused import statements at once.</p>
+</div>
+<div class="paragraph">
+<p>To add an import only for the type at which the cursor is located,
press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Shift-I</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-I</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/imports2.png" alt="imports2">
+</div>
+</div>
+<div class="paragraph">
+<p>When you select a class from the code completion window, the editor
automatically adds an import statement for it, so you do not need to worry
about this.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/imports.png" alt="imports">
+</div>
+</div>
+<div class="paragraph">
+<p>If there are unused import statements in your code, select the <span
class="image"><img src="images/bulberror.png" alt="bulberror"></span> warning
mark in the editor left-hand margin. Then choose either: to remove one unused
import or, all unused imports.</p>
+</div>
+<div class="paragraph">
+<p>In the editor, unused imports are underlined in yellow. See the <a
href="#_semantic_coloring_and_highlighting">Semantic Coloring and
Highlighting</a> section for details.</p>
+</div>
+<div class="paragraph">
+<p>To quickly see if your code contains unused or missing imports, watch the
error stripes in the righthand margin: orange stripes indicate missing or
unused imports.</p>
+</div>
+<div class="paragraph">
+<p>You can specify that, whenever you save a file, all the unused imports
should automatically be removed, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Select Tools > Options > Editor > On Save</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > On Save</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then for <strong>Language: Java</strong>, select the <strong>Remove Unused
Imports</strong> checkbox.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_generating_code"><a class="link" href="#_generating_code">Generating
Code</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>When working in the Java editor, you can generate pieces of code in one of
two ways: by using code completion or from the Code Generation dialog box.
Let’s take a closer look at simple examples of automatic code
generation.</p>
+</div>
+<div class="sect2">
+<h3 id="_using_the_code_generation_dialog_box"><a class="link"
href="#_using_the_code_generation_dialog_box">Using the Code Generation Dialog
Box</a></h3>
+<div class="paragraph">
+<p>In the editor, you can automatically generate: various constructs, whole
methods, override and delegate methods, add properties and more. To invoke code
generation, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Insert</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-I</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, choose <strong>Source > Insert Code…​</strong> from the
menu bar or, right-click and select <strong>Insert Code…​</strong>
anywhere in the editor to insert a construct from the Code Generation box. The
suggested list is adjusted to the current context.</p>
+</div>
+<div class="paragraph">
+<p>In the example below, we are going to generate a constructor for the
<code>ColorChooser</code> class. Select Constructor from the Code Generation
box, and specify the fields that will be initialized by the constructor. The
editor will generate the constructor with the specified parameters.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/codegeneration1.png" alt="codegeneration1">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_code_completion"><a class="link"
href="#_using_code_completion">Using Code Completion</a></h3>
+<div class="paragraph">
+<p>You can also generate code from the code completion window. In this
example, we use the same code fragment as above to demonstrate code generation
from the code completion window.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/codegeneration2.png" alt="codegeneration2">
+</div>
+</div>
+<div class="paragraph">
+<p>Press <code>Ctrl-Space</code> to open the code completion window and choose
the following item: <code>ColorChooser(String name, int number) -
generate</code>. The editor generates a constructor with the specified
parameters.</p>
+</div>
+<div class="paragraph">
+<p>In the code completion window, the constructors that can be generated
automatically are marked with the <span class="image"><img
src="images/newconstructor.png" alt="newconstructor"></span> icon and the "
<code>generate</code> " note.</p>
+</div>
+<div class="paragraph">
+<p>For more explanation of the icons and their meanings, see <a
href="#_appendix_a_icons_in_the_code_completion_window">Appendix A: Icons in
the Code Completion Window</a>.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_code_templates"><a class="link" href="#_code_templates">Code
Templates</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>A Code Template is a predefined piece of code that has an abbreviation
associated with it.</p>
+</div>
+<div class="sect2">
+<h3 id="_using_code_templates"><a class="link"
href="#_using_code_templates">Using Code Templates</a></h3>
+<div class="paragraph">
+<p>Code templates are marked with the <span class="image"><img
src="images/codetemplateicon.png" alt="codetemplateicon"></span> icon in the
code completion window.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/livetemplate.png" alt="livetemplate">
+</div>
+</div>
+<div class="paragraph">
+<p>You can use code templates by selecting one from the code completion window
or,
+by typing its abbreviation, found by selecting:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Templates</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Templates</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>and then <strong>Language: Java</strong> in the <strong>Code
Templates</strong> pane.</p>
+</div>
+<div class="paragraph">
+<p>The template can be expanded by pressing the default expansion key
<code>Tab</code>. In the expanded template, editable parts are displayed as
blue boxes. Use the <code>Tab</code> key again to go through the parts that
you need to edit.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_adding_or_editing_code_templates"><a class="link"
href="#_adding_or_editing_code_templates">Adding or Editing Code
Templates</a></h3>
+<div class="paragraph">
+<p>To add or edit code templates, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Code Templates</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Code Templates</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select <strong>Language: Java</strong>. In the
<strong>Templates:</strong> window you will be pesented with a list of
abbreviations each with an expanded text and description.</p>
+</div>
+<div class="paragraph">
+<p>Use the <strong>New</strong> and <strong>Remove</strong> buttons to modify
the templates list. To edit an existing template, select the template and edit
the code in the <strong>Expanded Text</strong> field. Then ideally, you should
add a <strong>Description</strong> as an aid memoir and, if necessary, a
<strong>Context</strong>.</p>
+</div>
+<div class="paragraph">
+<p>Choose your peferred key from the <strong>Expand Template on:</strong>
list, to activate your template. The default key is <code>Tab</code> .
Finally, select an action from the <strong>On Template Expansion:</strong>
list.</p>
+</div>
+<div class="paragraph">
+<p>See <a href="../php/code-templates.html">Code Templates in NetBeans IDE for
PHP</a>, for more information about templates.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_working_with_javadoc"><a class="link"
href="#_working_with_javadoc">Working with Javadoc</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Use the following features to facilitate working with Javadoc for your
code.</p>
+</div>
+<div class="sect2">
+<h3 id="_displaying_javadoc"><a class="link"
href="#_displaying_javadoc">Displaying Javadoc</a></h3>
+<div class="paragraph">
+<p>To display Javadoc, place the cursor on an element in your code and,
press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-Space</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-\</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or choose <strong>Source > Show Documentation</strong> from the menu
bar. The Javadoc for this element is displayed in a popup window.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/javadoc.png" alt="javadoc">
+</div>
+</div>
+<div class="paragraph">
+<p>From the menu bar, select <strong>Window > IDE Tools > Javadoc
Documentation</strong> to open the Javadoc window, in which the documentation
is refreshed automatically for the location of your cursor.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_creating_javadoc_stubs"><a class="link"
href="#_creating_javadoc_stubs">Creating Javadoc Stubs</a></h3>
+<div class="paragraph">
+<p>Place the cursor above a method or a class that has no Javadoc, type
<code>"/**</code> ", and press <code>Enter</code> .</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/javadoc1.png" alt="javadoc1">
+</div>
+</div>
+<div class="paragraph">
+<p>The IDE creates a skeletal structure for a Javadoc comment filled with some
content. If you have a Javadoc window open, you will see the changes
immediately while you are typing.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_javadoc_hints"><a class="link"
href="#_using_javadoc_hints">Using Javadoc Hints</a></h3>
+<div class="paragraph">
+<p>The editor displays hints when Javadoc is missing or Javadoc tags are
needed by displaying the bulb icon <span class="image"><img
src="images/bulb.png" alt="bulb"></span> in the left-hand margin, click the
bulb icon to fix Javadoc errors.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/javadoc2.png" alt="javadoc2">
+</div>
+</div>
+<div class="paragraph">
+<p>If you do not want to see the hints related to Javadoc, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Hints</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Hints</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>and clear the <strong>JavaDoc</strong> checkbox in the list of hints that
are displayed.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_code_completion_for_javadoc_tags"><a class="link"
href="#_using_code_completion_for_javadoc_tags">Using Code Completion for
Javadoc Tags</a></h3>
+<div class="paragraph">
+<p>Code completion is available for Javadoc tags.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/javadoc3.png" alt="javadoc3">
+</div>
+</div>
+<div class="paragraph">
+<p>Type the <code>@</code> symbol and wait until the code completion window
opens, depending on your settings, you may need to press
<code>Ctrl-Space</code>. Then select the required tag from the drop-down
list.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_generating_javadoc"><a class="link"
href="#_generating_javadoc">Generating Javadoc</a></h3>
+<div class="paragraph">
+<p>To generate Javadoc for a project, select <strong>Run > Generate
Javadoc</strong> from the menu bar or, right-click the project in the
<strong>Projects</strong> window and choose Generate Javadoc. The IDE will
generate the Javadoc and open it in a separate browser window.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/generate.png" alt="generate">
+</div>
+</div>
+<div class="paragraph">
+<p>In the example above, you can see a sample output of the Generate Javadoc
command. If there are some warnings or errors, they are also displayed in this
window.</p>
+</div>
+<div class="paragraph">
+<p>To customize Javadoc formatting options, right-click the project in the
<strong>Projects</strong> window, choose <strong>Properties</strong> and open
the <strong>Documenting</strong> panel under the <strong>Build</strong>
category. This is only available for Java projects.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_analyzing_javadoc"><a class="link"
href="#_analyzing_javadoc">Analyzing Javadoc</a></h3>
+<div class="paragraph">
+<p>To identify the places in your code that need Javadoc comments and quickly
insert these comments, you can use the Javadoc Analyzer tool available in the
Java editor.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/analyze-javadoc.png" alt="analyze javadoc">
+</div>
+</div>
+<div class="paragraph">
+<p>To analyze and fix Javadoc comments:</p>
+</div>
+<div class="paragraph">
+<p>Select a project, a package, or an individual file and choose <strong>Tools
> Analyze Javadoc</strong> from the menu bar. The <strong>Analyzer</strong>
window displays suggestions for adding or fixing Javadoc comments, depending on
the scope of your selection.</p>
+</div>
+<div class="paragraph">
+<p>Select one or, several checkboxes where you would like to fix Javadoc and
click the <strong>Fix Selected</strong> button.</p>
+</div>
+<div class="paragraph">
+<p>Click <strong>Go Over Fixed Problems</strong> and use the Up and Down
arrows to actually add your comments. This might be helpful if you opted to fix
several instances at once and now want to revisit the stubs.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_using_hints"><a class="link" href="#_using_hints">Using Hints</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>While you are typing, the Java editor checks your code and provides
suggestions of how you can fix errors and navigate through code. The examples
below show the types of hints that are available in the editor and how to
customize them.</p>
+</div>
+<div class="sect2">
+<h3 id="_using_hints_to_fix_code"><a class="link"
href="#_using_hints_to_fix_code">Using Hints to Fix Code</a></h3>
+<div class="paragraph">
+<p>For the most common coding mistakes, you can see hints in the left-hand
margin of the editor. The hints are shown for many types of errors, such as
missing field and variable definitions, problems with imports, braces, and
other. Click the hint icon and select the fix to add to your code.</p>
+</div>
+<div class="paragraph">
+<p>Hints are displayed automatically by default. However, if you want to view
all hints, choose <strong>Source > Fix Code</strong> from the menu bar or,
press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Enter</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Enter</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>For example, try typing <code>myBoolean=true</code>. The editor detects
that this variable is not defined. Click the hint icon <span class="image"><img
src="images/bulberror1.png" alt="bulberror1"></span> and, see the editor
suggests that you create a field, a method parameter, or a local variable.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/quickfixes.png" alt="quickfixes">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_surround_with"><a class="link" href="#_surround_with">Surround
With…​</a></h3>
+<div class="paragraph">
+<p>You can easily surround pieces of your code with various statements, such
as <code>for</code>, <code>while</code>, <code>if</code>,
<code>try/catch</code>, etc.</p>
+</div>
+<div class="paragraph">
+<p>Select a block in your code that you want to surround with a statement and
click the bulb icon <span class="image"><img src="images/bulb.png"
alt="bulb"></span> in the left-hand margin or, choose <strong>Source > Fix
Code</strong> from the menu bar or, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Enter</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Enter</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>The editor displays a pop-up list of suggestions from which you can select
the statement you need.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/surroundwith.png" alt="surroundwith">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_customizing_hints"><a class="link"
href="#_customizing_hints">Customizing Hints</a></h3>
+<div class="paragraph">
+<p>You might want to limit the number of categories for which hints are
displayed. To do this, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Editor > Hints</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Editor > Hints</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>then select <strong>Language: Java</strong> from the drop-down list. You
are presented with a list of elements for which hints can be displayed, select
the checkboxes of those that you want and deselect those you don’t.</p>
+</div>
+<div class="paragraph">
+<p>The IDE can detect compilation errors in your Java sources. By locating and
recompiling classes that depend on the file that you are modifying, even if
these dependencies are in the files that are not open in the editor. When a
compilation error is found, red badges are attached to source file, package, or
project nodes in the <strong>Projects</strong> window.</p>
+</div>
+<div class="paragraph">
+<p>Dependency scanning within projects can be resource consuming and degrade
performance, especially if you are working with large projects. To improve the
IDE’s performance, you can do one of the following:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>On the Hints tab, you can disable dependency scans, via the
<strong>Dependency Scanning</strong> option.</p>
+</li>
+<li>
+<p>For a specific Project, in the <strong>Projects</strong> window select
<strong>Properties > Build > Compiling</strong> and deselect the
<strong>Track Java Dependencies</strong> option. In this case, the IDE does not
scan for dependencies or update the error badges when you modify a file.</p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_semantic_coloring_and_highlighting"><a class="link"
href="#_semantic_coloring_and_highlighting">Semantic Coloring and
Highlighting</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The IDE’s Java editor shows code elements in distinct colors, based
on the semantics of your code. With semantic coloring, it becomes easier for
you to identify various elements in your code. In addition to coloring, the
Java editor highlights similar elements with a particular background color.
Thus, you can think of the highlighting feature as an alternative to the Search
command, because in combination with error stripes, it gives you a quick
overview of where the highlighted [...]
+</div>
+<div class="sect2">
+<h3 id="_customizing_colors"><a class="link"
href="#_customizing_colors">Customizing Colors</a></h3>
+<div class="paragraph">
+<p>The IDE provides several preset coloring schemes, which are called
profiles. You can create new profiles with custom colors and quickly switch
between them.</p>
+</div>
+<div class="paragraph">
+<p>To customize semantic coloring settings for the Java editor, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options > Fonts & Colors</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​ > Fonts & Colors</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>It is preferable to save custom colors in new profiles, to do this use the
following method:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>In the <strong>Fonts & Colors</strong> window, select a suitable
profile from the <strong>Profile:</strong> drop-down list as your starting
point.</p>
+</li>
+<li>
+<p>Click <strong>Duplicate</strong> next to the <strong>Profile:</strong> and,
enter a name for your new profile and click <strong>OK</strong>.</p>
+</li>
+<li>
+<p>Ensure that your new profile is currently selected <strong>Profile:
<myNewColorProfile></strong> and select <strong>Language:
Java</strong>.</p>
+</li>
+<li>
+<p>Select a <strong>Category:</strong> and then change the
<strong>Font:</strong>, <strong>Foreground:</strong>,
<strong>Background:</strong>, and <strong>Effects:</strong> for this category.
Use the <strong>Preview:</strong> window to view the results and when satisfied
click <strong>OK</strong>.</p>
+</li>
+</ul>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+All NetBeans IDE settings and profiles are stored in the <em>NetBeans
userdir</em>. When upgrading NetBeans, you can export your old settings and
import them into the new version.
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_exporting_and_importing_settings"><a class="link"
href="#_exporting_and_importing_settings">Exporting and Importing
Settings</a></h3>
+<div class="paragraph">
+<p>To export IDE settings, select:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p>Tools > Options</p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p>NetBeans > Preferences…​</p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>and click <strong>Export</strong>, specify the location and name of the ZIP
file that will be created. Select the settings that you want to export and
click <strong>OK</strong>.</p>
+</div>
+<div class="paragraph">
+<p>To import IDE settings:</p>
+</div>
+<div class="paragraph">
+<p>Open the <strong>Options/Preferences…​</strong> window and
click <strong>Import</strong>. Specify the location of the ZIP file to import
and then select the settings you want to import and click
<strong>OK</strong>.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_coloring_example"><a class="link" href="#_coloring_example">Coloring
Example</a></h3>
+<div class="paragraph">
+<p>In the figure below, you can see an example of a coloring scheme. Depending
upon your custom settings, your colors might look differently from those
shown.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/coloring.png" alt="coloring">
+</div>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Distinct colors are used for: keywords (blue), variables and fields
(green), and parameters (orange).</p>
+</li>
+<li>
+<p>References to deprecated methods or classes are shown as strikethrough.
This warns you when you are going to write code that relies on deprecated
members.</p>
+</li>
+<li>
+<p>Unused members are underlined with a gray wavy line.</p>
+</li>
+<li>
+<p>Comments are displayed in gray.</p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_highlights"><a class="link" href="#_using_highlights">Using
Highlights</a></h3>
+<div class="imageblock">
+<div class="content">
+<img src="images/highlightelement.png" alt="highlightelement">
+</div>
+</div>
+<div class="paragraph">
+<p>The IDE highlights usages of the same element, matching braces, method exit
points, and exception throwing points.</p>
+</div>
+<div class="paragraph">
+<p>If you place the cursor in an element, such as a field or a variable, all
usages of this element are highlighted. Note that error stripes in the
editor’s righthand margin indicate the usages of this element in the
entire source file (see <a href="#stripes">Error Stripes</a>). Click the error
stripe to quickly navigate to the desired usage location.</p>
+</div>
+<div class="paragraph">
+<p>If you decide to rename all the highlighted instances, use the Instant
Rename command (Ctrl-R or choose Refactor > Rename).</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_navigation"><a class="link" href="#_navigation">Navigation</a></h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The Java editor provides numerous ways to navigate through code. See below
for several examples that show the navigation features of the Java editor.</p>
+</div>
+<div class="sect2">
+<h3 id="_error_stripes"><a class="link" href="#_error_stripes">Error
Stripes</a></h3>
+<div class="paragraph">
+<p>Error stripes in the right-hand margin of the editor provide a quick
overview of all: errors, warnings, hints, highlighted occurrences, and
annotations in the current file. Note that the error stripe margin represents
an entire file, not just the part that is currently displayed in the editor.</p>
+</div>
+<div class="paragraph">
+<p>By using the error stripes, you can quickly identify whether your file has
any errors or warnings, without scrolling through the file. Clicking an error
stripe will jump to the corresponding line.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_navigating_from_the_editor_go_to"><a class="link"
href="#_navigating_from_the_editor_go_to">Navigating From the Editor: Go
to…​</a></h3>
+<div class="paragraph">
+<p>There are many ways of navigating through your code, use the following the
"Go to…​" commands located under the <strong>Navigate</strong> menu
to quickly jump to target locations:</p>
+</div>
+<div class="paragraph">
+<p>Select: a class, method or field in your code and then choose your desired
action:</p>
+</div>
+<div class="paragraph">
+<p><strong>Go to declaration</strong>, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-B</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-G</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Go to Declaration</strong> from the menu
bar or, right-click and select <strong>Navigate > Go To Declaration</strong>
from the pop-up menu. The editor then moves the cursor to its declaration
within: the current file or, if not there opens the appropriate file and
positions the cursor to the declaration of your selected item.</p>
+</div>
+<div class="paragraph">
+<p><strong>Go to source</strong>, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-B</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-B</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Go to Source</strong> from the menu bar
or, right-click and select <strong>Navigate > Go to Source</strong> from the
pop-up menu. The result of this action is similar to that of "go to
declaration". However, in this case it opens the file of the original "source
declaration".</p>
+</div>
+<div class="paragraph">
+<p>The difference between these two actions is: that both the declaration and
source could be in your current file or, the declaration in your current file
with the source in another or, that neither are in your current file and that
the declaration is in one and the source in another.</p>
+</div>
+<div class="paragraph">
+<p>If you know the name of the type (class, interface, annotation or enum),
file, or symbol to where you want to jump, use these commands and type the name
in the new window. Notice that you can use prefixes, camel case, and
wildcards.</p>
+</div>
+<div class="paragraph">
+<p><strong>Go to type</strong>, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-O</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-O</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Go to Type…​</strong> from the
menu bar.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/gototype.png" alt="gototype">
+</div>
+</div>
+<div class="paragraph">
+<p><strong>Go to file</strong>, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Shift-O</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-O</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Go to File…​</strong> from the
menu bar.</p>
+</div>
+<div class="paragraph">
+<p><strong>Go to symbol</strong>, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Alt-Shift-O</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-Command-O</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Go to Symbol…​</strong> from
the menu bar.</p>
+</div>
+<div class="paragraph">
+<p><strong>Go to line</strong>, press <code>Ctrl-G</code> or, select
<strong>Navigate > Go to Line</strong> from the menu bar, and enter the line
number to which you want to jump.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/gotoline.png" alt="gotoline">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_jumping_to_last_edit"><a class="link"
href="#_jumping_to_last_edit">Jumping to Last Edit</a></h3>
+<div class="paragraph">
+<p>To quickly return to your last edit, even if it is in another file or
project, press <code>Ctrl-Q</code> or use the button in the top left corner of
the Java editor toolbar. The last edited document opens, and the cursor is at
the position, which you edited last.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/jumplastedit.png" alt="jumplastedit">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_breadcrumbs"><a class="link" href="#_using_breadcrumbs">Using
Breadcrumbs</a></h3>
+<div class="paragraph">
+<p>Breadcrumbs are displayed along the bottom of the editor, the position of
the cursor in the document determines the breadcrumbs displayed. To activate
breadcrumbs, select <strong>View > Show Breadcrumbs</strong> from the menu
bar.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/breadcrumbs.png" alt="breadcrumbs">
+</div>
+</div>
+<div class="paragraph">
+<p>Click on an arrow associated with a breadcrumb to see all available class
members and select to jump to them.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_switching_between_files"><a class="link"
href="#_switching_between_files">Switching Between Files</a></h3>
+<div class="paragraph">
+<p>There are several features that allow you to switch between open files:</p>
+</div>
+<div class="paragraph">
+<p>To go to a previously edited file, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Left</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Left</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Back</strong>, from the menu bar.</p>
+</div>
+<div class="paragraph">
+<p>To move forward press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Alt-Right</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Right</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Forward</strong>, from the menu bar.</p>
+</div>
+<div class="paragraph">
+<p>Alternatively, you can press the corresponding buttons on the editor
toolbar, see the figure below. The file opens and the cursor is placed at the
location of your last edit. When you click one of these buttons, you can expand
the list of the recent files and click to navigate to any of them.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/jumprecentfile.png" alt="jumprecentfile">
+</div>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>You can toggle between files and windows by pressing <code>Ctrl-Tab</code>.
After you press <code>Ctrl-Tab</code>, a pop-up window opens containg two
panes: the left-hand pane shows a list of all open files and, the right-hand
pane shows a list of all windows. Hold down the <code>Ctrl</code> key then
press and release the <code>Tab</code> key to move forward through the list.
Hold down <code>Ctrl-Shift</code> then press and release the <code>Tab</code>
key to move backward through th [...]
+</li>
+</ul>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+If you continue pressing the <code>Tab</code> key you will also cycle through
the windows list as well.
+</td>
+</tr>
+</table>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/togglefile.png" alt="togglefile">
+</div>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>You can show all open documents by pressing, <code>Shift-F4</code> or,
select <strong>Windows > Documents…​</strong> from the menu bar.
After you have selected the <strong>Documents</strong> window, all open files
are shown. Order the files based on your needs and choose the file you would
like to open.</p>
+</li>
+</ul>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/shift-f4.png" alt="shift f4">
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_bookmarks"><a class="link" href="#_using_bookmarks">Using
Bookmarks</a></h3>
+<div class="paragraph">
+<p>You can use bookmarks to quickly navigate to specific places in your code.
To create a bookmark, place the cursor anywhere in a line of code and,
press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-M</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-M</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>or, select <strong>Navigate > Toggle Bookmark</strong> from the menu bar
or, right-click the left margin and choose <strong>Bookmark > Toggle
Bookmark</strong>.</p>
+</div>
+<div class="paragraph">
+<p>Alternatively, you can select <strong>View > Show Editor
Toolbar</strong> from the menu bar. The new toolbar is positioned at the top of
the current document in the editor window. There you will find a variety of
icons, specifically, three that relate to bookmarks: <strong>Previous
Bookmark</strong>, <strong>Next Bookmark</strong> and <strong>Toggle
Boomark</strong></p>
+</div>
+<div class="paragraph">
+<p>A bookmarked line is shown with a small blue icon in the left margin, as
shown below.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/bookmark.png" alt="bookmark">
+</div>
+</div>
+<div class="paragraph">
+<p>To remove the bookmark, press the key combination again.</p>
+</div>
+<div class="paragraph">
+<p>To clear all document bookmarks, you need to customize the Toolbar, to do
this select <strong>View > Toolbars > Customize</strong>. In the pop-up
window scroll down to category <strong>Edit</strong> and, if necessary expand
it, then drag the <strong>Clear Document Bookmarks</strong> icon to your
toolbar.</p>
+</div>
+<div class="paragraph">
+<p>To go to the next bookmark, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-Period</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-Period</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>To go to the previous bookmark, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-Shift-Comma</code></p>
+</td>
+</tr>
+<tr>
+<td class="hdlist1">
+<strong>macOS</strong>™
+</td>
+<td class="hdlist2">
+<p><code>Command-Shift-Comma</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>Automatically a pop-up list of bookmarks appears containing all the
bookmarks visited in your current session, including those files that are not
currently open in the editor.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/bookmark2.png" alt="bookmark2">
+</div>
+</div>
+<div class="paragraph">
+<p>You can move forward or backward by repeatedly releasing and pressing the
<code>Period</code> key or <code>Comma</code> key as appropriate to highlight
your chosen bookmark. Then when you release the whole key combination the
cursor is moved to the bookmark in your code.</p>
+</div>
+<div class="paragraph">
+<p>If the file is not the topmost, the editor will switch to that file and
move the cursor to the selected bookmark. Selecting a bookmark in a closed file
will cause the editor to open that file and position the cursor at the required
bookmark.</p>
+</div>
+<div class="paragraph">
+<p>If you select the <strong><Bookmarks></strong> item in the pop-up
list, as shown in the figure above or, when you select <strong>Window > IDE
Tools > Bookmarks</strong> from the menu bar, the <strong>Bookmarks</strong>
window opens.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/bookmark3-small.png" alt="bookmark3 small">
+</div>
+</div>
+<div class="paragraph">
+<p>The <strong>Bookmarks</strong> window contains two panes: one showing all
visited bookmarks in the current session and, the other a view of the code
related to the currently highlighted bookmark. You cannot edit anything in this
window, it is there so that you can see if the correct bookmark has been
selected in the bookmarks pane.</p>
+</div>
+<div class="paragraph">
+<p>In the bookmarks pane you can select either a <strong>Tree View</strong>
or, a <strong>Table View</strong>. In <strong>Table View</strong> you can
assign keys and labels to bookmarks, so that when <code>Ctrl-G</code> is
pressed, you can quickly jump to a labelled bookmark in your code.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_using_the_navigator"><a class="link"
href="#_using_the_navigator">Using the Navigator</a></h3>
+<div class="paragraph">
+<p>The Navigator window provides structured views of the file you are working
with and lets you quickly navigate between different parts of the file.</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<img src="images/navigatorwindow.png" alt="navigatorwindow">
+</div>
+</div>
+<div class="paragraph">
+<p>To open the Navigator window, choose <strong>Window > Navigator</strong>
or, press:</p>
+</div>
+<div class="hdlist">
+<table>
+<tr>
+<td class="hdlist1">
+<strong>Windows</strong>™/<strong>Linux</strong>
+</td>
+<td class="hdlist2">
+<p><code>Ctrl-7</code></p>
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+There is no keyboard shortcut set for <strong>macOS</strong>™. See
<strong>Customizing Keyboard Shortcuts</strong> to learn how to set missing
shortcuts.
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>In the Navigator window, you can do the following:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Choose between different views: Members, Bean Patterns, Trees, Elements,
etc.</p>
+</li>
+<li>
+<p>Double-click an element to jump to the line where it is defined.</p>
+</li>
+<li>
+<p>Right-click an element and apply commands, such as Go to Source, Find
Usages, and Refactor.</p>
+</li>
+<li>
+<p>Apply filters to the elements displayed in the <strong>Navigator</strong>,
select the buttons at the bottom.</p>
+</li>
+<li>
+<p>Type the name of the element that you want to find, the
<strong>Navigator</strong> window must be active.</p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_appendix_a_icons_in_the_code_completion_window"><a class="link"
href="#_appendix_a_icons_in_the_code_completion_window">Appendix A: Icons in
the Code Completion Window</a></h2>
+<div class="sectionbody">
+<table class="tableblock frame-all grid-all spread">
+<colgroup>
+<col style="width: 12.5%;">
+<col style="width: 37.5%;">
+<col style="width: 12.5%;">
+<col style="width: 37.5%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Icon</th>
+<th class="tableblock halign-left valign-top">Meaning</th>
+<th class="tableblock halign-left valign-top">Variants (if any)</th>
+<th class="tableblock halign-left valign-top">Meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/annotation_type.png" alt="annotation
type"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Annotation
type</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/class_16.png" alt="class 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Class</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/package.png" alt="package"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Package</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/enum.png" alt="enum"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Enum
type</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/code_template.png" alt="code
template"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Code
Template</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/constructor_16.png" alt="constructor
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Constructor</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/new_constructor_16.png" alt="new constructor
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">New
constructor (generate)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/constructor_protected_16.png" alt="constructor
protected 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Protected
constructor</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/constructor_private_16.png" alt="constructor
private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Private
constructor</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/constructor_package_private_16.png"
alt="constructor package private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Package
private constructor</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_16.png" alt="field 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Field</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_protected_16.png" alt="field protected
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Protected
field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_private_16.png" alt="field private
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Private
field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_package_private_16.png" alt="field package
private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Package
private field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_static_16.png" alt="field static
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Static
field</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_static_protected_16.png" alt="field static
protected 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Protected
static field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_static_private_16.png" alt="field static
private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Private
static field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/field_static_package_private_16.png" alt="field
static package private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Package
private static field</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/interface.png" alt="interface"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Interface</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/javakw_16.png" alt="javakw 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Java
keyword</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_16.png" alt="method 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Method</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_protected_16.png" alt="method protected
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Protected
method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_private_16.png" alt="method private
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Private
method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_package_private_16.png" alt="method
package private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Package
private method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_static_16.png" alt="method static
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Static
method</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_static_protected_16.png" alt="method
static protected 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Protected
static method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_static_private_16.png" alt="method static
private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Private
static method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/method_static_package_private_16.png"
alt="method static package private 16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Package
private static method</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/localVariable.png"
alt="localVariable"></span></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Local
variable</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><span
class="image"><img src="images/attribute_16.png" alt="attribute
16"></span></p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Attribute</p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+
+<section class='tools'>
+ <ul class="menu align-center">
+ <li><a title="Facebook" href="https://www.facebook.com/NetBeans"><i
class="fa fa-md fa-facebook"></i></a></li>
+ <li><a title="Twitter" href="https://twitter.com/netbeans"><i
class="fa fa-md fa-twitter"></i></a></li>
+ <li><a title="Github"
href="https://github.com/apache/incubator-netbeans"><i class="fa fa-md
fa-github"></i></a></li>
+ <li><a title="YouTube"
href="https://www.youtube.com/user/netbeansvideos"><i class="fa fa-md
fa-youtube"></i></a></li>
+ <li><a title="Slack"
href="https://tinyurl.com/netbeans-slack-signup/"><i class="fa fa-md
fa-slack"></i></a></li>
+ <li><a title="JIRA"
href="https://issues.apache.org/jira/projects/NETBEANS/summary"><i class="fa
fa-mf fa-bug"></i></a></li>
+ </ul>
+ <ul class="menu align-center">
+
+ <li><a
href="https://github.com/apache/incubator-netbeans-website/blob/master/netbeans.apache.org/src/content/kb/docs/java/editor-codereference.asciidoc"
title="See this page in github"><i class="fa fa-md fa-edit"></i> See this page
in GitHub.</a></li>
+ </ul>
+</section>
+
+ </div>
+
+
+<div class='grid-container incubator-area' style='margin-top: 64px'>
+ <div class='grid-x grid-padding-x'>
+ <div class='large-auto cell text-center'>
+ <a href="https://www.apache.org/">
+ <img style="width: 320px" title="Apache Software Foundation"
src="/images/asf_logo_wide.svg" />
+ </a>
+ </div>
+ <div class='large-auto cell text-center'>
+ <a href="https://www.apache.org/events/current-event.html">
+ <img style="width:234px; height: 60px;" title="Apache Software
Foundation current event"
src="https://www.apache.org/events/current-event-234x60.png"/>
+ </a>
+ </div>
+ </div>
+</div>
+<footer>
+ <div class="grid-container">
+ <div class="grid-x grid-padding-x">
+ <div class="large-auto cell">
+
+ <h1>About</h1>
+ <ul>
+ <li><a
href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
+ <li><a
href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+ <li><a
href="https://www.apache.org/security/">Security</a></li>
+ <li><a
href="https://incubator.apache.org/projects/netbeans.html">Incubation
Status</a></li>
+ </ul>
+ </div>
+ <div class="large-auto cell">
+ <h1><a href="/community/index.html">Community</a></h1>
+ <ul>
+ <li><a href="/community/mailing-lists.html">Mailing
lists</a></li>
+ <li><a href="/community/committer.html">Becoming a
committer</a></li>
+ <li><a href="/community/events.html">NetBeans
Events</a></li>
+ <li><a
href="https://www.apache.org/events/current-event.html">Apache Events</a></li>
+ </ul>
+ </div>
+ <div class="large-auto cell">
+ <h1><a href="/participate/index.html">Participate</a></h1>
+ <ul>
+ <li><a href="/participate/submit-pr.html">Submitting Pull
Requests</a></li>
+ <li><a href="/participate/report-issue.html">Reporting
Issues</a></li>
+ <li><a
href="/participate/index.html#documentation">Improving the
documentation</a></li>
+ </ul>
+ </div>
+ <div class="large-auto cell">
+ <h1><a href="/help/index.html">Get Help</a></h1>
+ <ul>
+ <li><a
href="/help/index.html#documentation">Documentation</a></li>
+ <li><a href="/wiki/index.asciidoc">Wiki</a></li>
+ <li><a href="/help/index.html#support">Community
Support</a></li>
+ <li><a href="/help/commercial-support.html">Commercial
Support</a></li>
+ </ul>
+ </div>
+ <div class="large-auto cell">
+ <h1><a href="/download/nb100/nb100.html">Download</a></h1>
+ <ul>
+ <li><a href="/download/index.html">Releases</a></li>
+ <li><a href="/plugins/index.html">Plugins</a></li>
+ <li><a href="/download/index.html#source">Building from
source</a></li>
+ <li><a href="/download/index.html#previous">Previous
releases</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+</footer>
+<div class='footer-disclaimer'>
+ <div class="footer-disclaimer-content">
+ <p>Copyright © 2017-2019 <a href="https://www.apache.org">The
Apache Software Foundation</a>.</p>
+ <p>Licensed under the Apache <a
href="https://www.apache.org/licenses/">license</a>, version 2.0</p>
+ <p><a href="https://incubator.apache.org/" alt="Apache Incubator"><img
src='/images/incubator_feather_egg_logo_bw_crop.png' title='Apache
Incubator'></img></a></p>
+ <div style='max-width: 40em; margin: 0 auto'>
+ <p>Apache NetBeans is an effort undergoing incubation at The
Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation
is required of all newly accepted projects until a further review indicates
that the infrastructure, communications, and decision making process have
stabilized in a manner consistent with other successful ASF projects. While
incubation status is not necessarily a reflection of the completeness or
stability of the code, it does indicate [...]
+ <p>Apache Incubator, Apache, Apache NetBeans, NetBeans, the Apache
feather logo, the Apache NetBeans logo, and the Apache Incubator project logo
are trademarks of <a href="https://www.apache.org">The Apache Software
Foundation</a>.</p>
+ <p>Oracle and Java are registered trademarks of Oracle and/or its
affiliates.</p>
+ </div>
+
+ </div>
+</div>
+
+
+
+ <script src="/js/vendor/jquery-3.2.1.min.js"></script>
+ <script src="/js/vendor/what-input.js"></script>
+ <script src="/js/vendor/jquery.colorbox-min.js"></script>
+ <script src="/js/vendor/foundation.min.js"></script>
+ <script src="/js/netbeans.js"></script>
+ <script>
+
+ $(function(){ $(document).foundation(); });
+ </script>
+
+ <script
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
+ <script>
+ $(document).ready(function() { $("pre code").each(function(i, block)
{ hljs.highlightBlock(block); }); });
+ </script>
+
+ </body>
+</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists