This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-website.git


The following commit(s) were added to refs/heads/master by this push:
     new ffde89f  Revised documentation for 'editor-coderefrence.asciidoc (#318)
ffde89f is described below

commit ffde89f4f43f4c20f8bad3c2ac6fa6cd1ad46863
Author: JeremyCavanagh <[email protected]>
AuthorDate: Mon Feb 18 08:27:28 2019 +0100

    Revised documentation for 'editor-coderefrence.asciidoc (#318)
    
    * Rewritten document to include macOS details
    
    * Revised image
    
    * Added Linux as suggested by Laszlo
---
 .../kb/docs/java/editor-codereference.asciidoc     | 937 +++++++++++++--------
 .../content/kb/docs/java/images/code-folded2a.png  | Bin 0 -> 15560 bytes
 2 files changed, 568 insertions(+), 369 deletions(-)

diff --git 
a/netbeans.apache.org/src/content/kb/docs/java/editor-codereference.asciidoc 
b/netbeans.apache.org/src/content/kb/docs/java/editor-codereference.asciidoc
index c0474c5..99ab923 100644
--- a/netbeans.apache.org/src/content/kb/docs/java/editor-codereference.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/java/editor-codereference.asciidoc
@@ -1,4 +1,4 @@
-// 
+//
 //     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
@@ -6,9 +6,9 @@
 //     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
@@ -17,669 +17,869 @@
 //     under the License.
 //
 
+//============================================================ The Title 
(Start)
+
 =  Code Assistance in the NetBeans IDE Java Editor: A Reference Guide
+
+//============================================================== The Title 
(End)
+
+//============================================================= Metadata 
(Start)
+
 :jbake-type: tutorial
-:jbake-tags: tutorials 
+:jbake-tags: tutorials
 :jbake-status: published
+:reviewed: 2019-02-17
 :syntax: true
-:icons: font
 :source-highlighter: pygments
-:icons: font
 :toc: left
 :toc-title:
-:description:  Code Assistance in the NetBeans IDE Java Editor: A Reference 
Guide - Apache NetBeans
+:icons: font
+:sectlinks:
+:description: Code Assistance in the NetBeans IDE Java Editor: A Reference 
Guide - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials,  Code Assistance in the NetBeans IDE 
Java Editor: A Reference Guide
 
+//=============================================================== Metadata 
(End)
+
+//============================================================= Preamble 
(Start)
 
 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.
 
+//=============================================================== Preamble 
(End)
+
+//============================================== General Editor Features 
(Start)
+
+== General Editor Features
+
+//==============================================================================
+
+=== Code Formatting
+
+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:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Shift-F`
+*macOS*(TM):: `Ctrl-Shift-F`
+
+or, select *Source > Format* from the menu bar or, right-click and select 
*Format*. Your code will then be formatted according to the rules specified in 
the Formatting pane.
+
+To customize the formatting behaviour, open the formatting pane by selecting:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Formatting
+*macOS*(TM):: NetBeans > Preferences... > Editor > Formatting
+
+then select *Language: Java*. From the *Category:* 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.
+
+//==============================================================================
+
+=== Inserting and Highlighting Braces, Brackets, and Quotes
+
+By default, the editor automatically inserts matching pairs for braces, 
brackets, parentheses and, quote marks. When you type an opening brace and then 
press `Enter`, the closing brace is added automatically. However, for  `(`,  
`[`,  `"`, and  `'`, the editor inserts the matching pair immediately, and 
positions the cursor between them.
+
+If, for some reason, this feature is disabled, you can enable it by selecting:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Code Completion
+*macOS*(TM):: NetBeans > Preferences... > Editor > Code Completion
+
+then in the *Language: All Languages* pane select the *Insert Closing Brackets 
Automatically* checkbox.
+
+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.
+
+NOTE: 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.
+
+To customize the highlight colors, select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Fonts & Colors > Highlighting
+*macOS*(TM):: NetBeans > Preferences... > Fonts & Colors > Highlighting
+
+//==============================================================================
+
+=== Code Folding
+
+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.
+
+image::images/code-folded2a.png[]
+
+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.
+
+More options for collapsing and expanding code blocks can be found by 
selecting *View > Code Folds* from the menu bar or, right-click select *Code 
Folds*, where you will also find keyboard shortcuts.
+
+To customize the code folding options select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Folding
+*macOS*(TM):: NetBeans > Preferences... > Editor > Folding
+
+then select *Language : Java*. There you will find various options.
+
+//==============================================================================
+
+=== Customizing Keyboard Shortcuts
+
+To customize keyboard shortcuts, select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Keymap
+*macOS*(TM):: NetBeans > Preferences... > Keymap
+
+then select *Manage Profiles...* . Select the profile you want to use as a 
base for your new profile and click *Duplicate*, rename your profile and click 
*OK*, then *Close*.
+
+Ensure that your new profile is selected, *Profile: <myNewProfileName>* and 
then you can modify the shortcuts you need.
+
+To edit a shortcut, double-click in the *Shortcut* field or, click the 
ellipsis button ( `...` ) and select *Edit...* As you press a sequence of keys, 
the syntax for them is added. If you want to add special keys, such as:  `Tab` 
,  `Escape` or,  `Enter` etc., click the ellipsis button ( `...` ) again and 
select the key from the pop-up window. When you have finished editing your 
shortcuts, click *OK* in the *Keymap* window.
+
+You can save customized sets of your shortcuts as profiles. Then, you can 
switch from one profile to another to quickly change multiple settings.
+
+To find a shortcut for a specific command, type the command name in the Search 
field.
+
+//================================================ General Editor Features 
(End)
+
+//====================================================== Code Completion 
(Start)
+
 == Smart Code Completion
 
-The NetBeans IDE's Java Editor helps you quickly complete and generate code 
through the "smart" code completion feature. In a general sense, code 
completion is very useful when you want to fill in the missing code, look at 
the options available in the context of your application, and generate blocks 
of code when needed. See below for examples of how to use code completion.
+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.
+
+//==============================================================================
 
 === Invoking Code Completion
 
+To invoke code completion press  `Ctrl-Space` or, choose *Source > Complete 
Code...* 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  `java.lang`  package.
+
+To customize the code completion settings, select:
+
+[horizontal]
+*Windows* (TM):: Tools > Options > Editor > Code Completion
+*macOS* (TM):: NetBeans > Preferences... > Editor > Code Completion
 
-[.feature]
---
-image::images/codecompletion3.png[role="left"]
---
+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 *Language: All 
Languages*, select the *Auto Popup Completion Window* checkbox to invoke code 
completion automatically when you type certain characters. The default 
character for *Language: Java* is " `.` ", but you can add your own characters.
 
-Press  ``Ctrl-Space``  (or choose Source > Complete Code from the main menu) 
to open the code completion box. While you are typing, the list of suggestions 
shortens. The suggestions listed include those imported in your source file and 
symbols from the  ``java.lang``  package.
+To add characters that will invoke code completion, select the *Language: 
Java* pane and type your characters in the *Auto Popup Triggers for Java:* 
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.
 
-To customize the code completion settings, select Tools > Options > Editor > 
Code Completion.
+When the *Auto Popup Completion Window* checkbox is not selected, you need to 
press  `Ctrl-Space`  each time you want to invoke code completion.
 
-For example, you can set the code completion window to pop up either 
automatically or only on an as-needed basis. On the Code Completion tab, select 
the Auto Popup Completion Window checkbox to invoke the code completion window 
automatically when you are typing certain characters. The default character is 
" ``.`` ", but you can add your own characters.
+Instead of using  `Ctrl-Space`  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:
 
-To add characters that invoke the code completion window, select Java from the 
Language drop-down list and type your characters in the Auto Popup Triggers for 
Java field. The code completion window will pop up every time you type the 
specified characters.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-K`
+*macOS*(TM):: `Command-K`
 
-When the Auto Popup Completion Window checkbox is disabled, you need to press  
``Ctrl-Space``  each time you want to use code completion.
+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.
 
-Instead of using  ``Ctrl-Space``  for code completion, you can use "hippie 
completion" instead. Hippie completion analyzes text in the visible scope and 
suggests to complete a word with a keyword, class name, method, or variable. 
Press  ``Ctrl-K``  and the editor automatically completes the word you're 
typing for you, using hippie completion, by searching in your current document 
(and if not found) in other documents.
+The first time  `Ctrl-Space`  is pressed only items matching the type, in this 
example an  `int`, are shown.
 
- 
-[.feature]
---
-image::images/codecompletion4.png[role="right"]
---
+image::images/codecompletion3.png[]
 
-The first time  ``Ctrl-Space``  is pressed, only items matching the type, in 
this example an  ``int`` , are shown. Press  ``Ctrl-Space``  a second time, 
that is, press  ``Ctrl-Space``  twice, and _all_ the available items are shown, 
regardless of whether they match the provided type, as shown in the example on 
the left.
+Press  `Ctrl-Space`  a second time and _all_ available items are shown, 
regardless of whether they match the provided type, as shown below.
 
+image::images/codecompletion4.png[]
+
+Also, you can select for *Language: Java* the *Auto Popup on Typing Any Java 
Identifier Part* checkbox and, as you type keywords etc., code completion 
automatically presents you with an appropriate list of options.
+
+//==============================================================================
 
 === Smart Suggestions at the Top
 
-[.feature]
---
-image::images/smartcompletion1.png[role="left"] 
---
+Code completion is "smart", and will present the most  relevant suggestions at 
the top, above the black line in the code completion list.
 
-In NetBeans IDE, Java code completion is "smart," which means that the 
suggestions that are the most relevant for the context of your code are 
displayed at the top, above the black line in the code completion window.
+In the example below, the editor suggests inserting the  `LinkedHashMap`  
constructor from the  `java.util`  package.
 
-In the example on the left, the editor suggests inserting the  
``LinkedHashMap``  constructor from the  ``java.util``  package.
+image::images/smartcompletion1.png[]
 
-If the "smart" suggestions are not the ones you want to use, press  
``Ctrl-Space``  again to see the complete list, as shown above.
+If the "smart" suggestions are not the ones you want to use, press  
`Ctrl-Space`  again to see the complete list.
 
- 
-=== Camel Case Completion
+//==============================================================================
 
-[.feature]
---
-image::images/camelcase.png[role="left"]
---
+=== Camel Case Completion
 
 Instead of typing consecutive characters, and then calling code completion, 
you can type the initial capital letters of the word you're interested in.
 
-For example, type  ``IE`` , press  ``Ctrl-Space`` , and you will see a list of 
suggestions that match via camel case completion using the letter  ``I``  and 
then the letter  ``E`` .
+For example, type  `IE` , press  `Ctrl-Space` , and you will see a list of 
suggestions that match via camel case completion using the letter  `I`  and 
then the letter  `E` .
+
+image::images/camelcase.png[]
+
+//==============================================================================
 
- 
 === Completing Keywords
 
-[.feature]
---
-image::images/keywords.png[role="left"] 
---
+Use code completion to complete keywords in your code. The editor analyzes the 
context and suggests the most relevant keywords.
 
-Use code completion ( ``Ctrl-Space)``  to complete keywords in your code. The 
editor analyzes the context and suggests the most relevant keywords.
+In the example below, the  `ColorChooser`  class needs to extend the  `JPanel` 
 class. You can quickly add the keyword  `extends`  from the suggested items.
 
-In the example on the left, the  ``ColorChooser``  class needs to extend the  
``JPanel``  class. You can quickly add the keyword  ``extends``  from the 
suggested items.
+image::images/keywords.png[]
 
+//==============================================================================
 
 === Suggesting Names for Variable and Fields
 
-[.feature]
---
-image::images/names.png[role="left"] 
---
+When you are adding a new field or a variable, use code completion to choose a 
name that matches its type.
 
-When you are adding a new field or a variable, use code completion ( 
``Ctrl-Space)``  to choose a name that matches its type.
+Type a prefix for the new name, press  `Ctrl-Space`  and select the name you 
want to use from the list of suggestions.
 
-Type a prefix for the new name, press  ``Ctrl-Space``  and select the name you 
want to use from the list of suggestions.
+image::images/names.png[]
+
+//==============================================================================
 
- 
 === Suggesting Parameters
 
-[.feature]
---
-image::images/parameter.png[]
---
+The editor determines the most likely parameters for variables, methods, or 
fields and displays the suggestions in a pop-up box.
+
+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  `Tab`  or  `Enter`  keys.
 
-The editor guesses on the parameters for variables, methods, or fields and 
displays the suggestions in a pop-up box.
+You can invoke the tooltips with method parameters by pressing:
 
-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  ``Tab``  or  ``Enter``  keys.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-P`
+*macOS*(TM):: `Command-P`
 
-You can invoke the tooltips with method parameters by pressing  ``Ctrl-P``  
(or Source > Show Method Parameters) at any time.
+or, selecting *Source > Show Method Parameters* from the menu bar at any time.
+
+image::images/parameter.png[]
+
+//==============================================================================
 
- 
 === Common Prefix Completion
 
-[.feature]
---
+You can use the  `Tab`  key to quickly fill in the most commonly used prefixes 
and single suggestions. To check out how this feature works, try typing the 
following:
+
+Type  `System.out.p`  and wait for code completion to show all fields and 
methods that start with "p". All the suggestions will be related to "print".
+
 image::images/prefixcompletion.png[]
---
 
-You can use the  ``Tab``  key to quickly fill in the most commonly used 
prefixes and single suggestions.
+Press the  `Tab`  key and the editor automatically fills in the "print". You 
can continue and type "l" and, after pressing `Tab` again, "println" will be 
added.
 
-To check out how this feature works, try typing the following:
+//==============================================================================
 
-1. Type  ``System.out.p``  and wait for code completion to show all fields and 
methods that start with "p." All the suggestions will be related to "print."
-2. Press the  ``Tab``  key and the editor automatically fills in the "print". 
You can continue and type "l" and, after pressing Tab, the "println" will be 
added.
- 
 === Subword Completion
 
+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  `prop` you 
will see all method calls that relate to property change listening.
+
 image::images/subcompletion.png[]
 
-Sometimes you may not remember how an items starts, making it difficult to use 
code completion. Instead, to see all items that relate to listening to property 
changes, you can specify that subword completion should be enabled, so that you 
can use  ``prop``  in code completion, to see all method calls that relate to 
property change listening.
+To implement this feature, select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Code Completion
+*macOS*(TM):: NetBeans > Preferences... > Editor > Code Completion
+
+then select in the *Language: Java* pane, the *Subword completion* checkbox.
+
+You can then type part of the method you want to call, in this case `prop`, 
then invoke code completion, relevant alternatives all applicable to properties 
on the object, in this example, are displayed.
+
+//==============================================================================
 
-1. Select Tools > Options > Editor > Code Completion.
-2. Check the Subword completion checkbox in the Editor | Code Completion tab 
in the Options window.
-3. Type part of the method you want to call,  ``prop``  as shown here, and 
then call up code completion. Relevant subwords, all applicable to properties 
on the object, in this example, are displayed.
- 
 === Chain Completion
 
+When you need to type a chain of commands, you can use code completion. By  
pressing  `Ctrl-Space`  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.
+
 image::images/chain.png[]
 
-When you need to type a chain of commands, use smart code completion, that is, 
press  ``Ctrl-Space``  twice, and available chains will be shown. The editor 
scans variables, fields, and methods, that are visible from the context, and it 
will then suggest a chain that satisfies the expected type.
 
- 
+//==============================================================================
+
 === Completion of Static Imports
 
-image::images/static.png[] 
+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  
`Ctrl-Space`  twice, all available static import statements will be shown.
 
-When you need to complete a statement while needing to make use of a static 
import statement, use smart code completion, that is, press  ``Ctrl-Space``  
twice, and available static import statements will be shown.
+image::images/static.png[]
 
-If you would like static import statements to be added automatically when you 
complete static statements as described above, go to Tools > Options > Editor > 
Formatting, select Java from the Language drop-down and Imports from the 
Category drop-down. Check the Prefer Static Imports checkbox.
+If you would like static import statements to be added automatically, select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Formatting
+*macOS*(TM):: NetBeans > Preferences... > Editor > Formatting
+
+then from the *Language: Java*,  *Category: Imports* pane select the *Prefer 
Static Imports* checkbox.
+
+//==============================================================================
 
- 
 === Excluding Items from Completion
 
-[.feature]
---
-image::images/exclude2-small.png[role="left"]
---
+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.
+
+image::images/exclude2-small.png[]
+
+You can add or modify your exclusion rules either when "Configure excludes" is 
selected from the code completion list or, by selecting:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Code Completion
+*macOS*(TM):: NetBeans > Preferences... > Editor > Code Completion
 
-Time is wasted when code completion returns classes that you seldom or never 
use. When you use smart code completion, that is, when you press  
``Ctrl-Space``  twice, a lightbulb within the returned items lets you exclude 
items from code completion.
+then in the *Language: Java* pane, make your changes to the 
*Packages/classes:* list.
 
-[.feature]
---
-image:images/exclude.png[role="left"]
---
+image::images/exclude.png[]
 
-Either when "Configure excludes" is selected in code completion or when you go 
to Tools > Options > Editor > Code Completion, you can modify the exclusion 
rules you have defined.
+//==============================================================================
 
- 
 === JPA Completion
 
+When you are using the Java Persistence Annotation specification (JPA), you 
can complete SQL expressions in  `@NamedQuery`  statements via code completion.
+
 image::images/jpacompletion.png[]
 
-When you are using the Java Persistence Annotation specification (JPA), you 
can complete SQL expressions in  ``@NamedQuery``  statements via code 
completion.
+In the code completion window, icons are used to distinguish different members 
of the Java language. See <<appendixa,Appendix A: Icons in the Code Completion 
Window>> at the end of this document to see the meanings of these icons.
+
+//======================================================== Code Completion 
(End)
 
- 
-In the code completion window, icons are used to distinguish different members 
of the Java language. See <<appendixa,Appendix A>> at the end of this document 
to see the meanings of these icons.
+//==================================================== Managing Imports  
(Start)
 
 == Managing Imports
 
-There are several ways of how you can work with import statements. The IDE's 
Java 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.
+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.
+
+image::images/imports3.png[]
+
+When a non-imported class is found, the image:images/bulberror1.png[] error 
mark appears in the IDE's left-hand margin (also called the _glyph margin_). 
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.
+
+While you are typing, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Shift-I`
+*macOS*(TM):: `Command-Shift-I`
 
-[.feature]
---
-image::images/imports3.png[role="left"]
---
+or, choose *Source > Fix Imports* from the menu bar or, right-click and choose 
*Source > Fix Imports*, to add all missing import statements and, remove all 
unused import statements at once.
 
-When a non-imported class is found, the image:images/bulberror1.png[] error 
mark appears in the IDE's lefthand margin (this margin is also called the 
_glyph margin_). Click the error mark and choose whether to add the missing 
import or create this class in the current package.
+To add an import only for the type at which the cursor is located, press:
 
-While you are typing, press  ``Ctrl-Shift-I``  (or choose Source > Fix Imports 
from the menu) to add all missing import statements at once.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Shift-I`
+*macOS*(TM):: `Ctrl-Shift-I`
 
-Press  ``Alt-Shift-I``  to add an import only for the type at which the cursor 
is located.
+image::images/imports2.png[]
 
-[.feature]
---
-image::images/imports2.png[role="right"]
---
+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.
 
-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.
+image::images/imports.png[]
 
-[.feature]
---
-image::images/imports.png[role="left"]
---
+If there are unused import statements in your code, select the 
image:images/bulberror.png[] warning mark in the editor left-hand margin. Then 
choose either: to remove one unused import or, all unused imports.
 
-If there are unused import statements in your code, press the 
image:images/bulberror.png[] warning mark in the Editor lefthand margin and 
choose either to remove one unused import or all unused imports. In the Editor, 
unused imports are underlined (see the <<coloring,Semantic Coloring>> section 
for details).
+In the editor, unused imports are underlined in yellow. See the <<Semantic 
Coloring and Highlighting>> section for details.
 
-To quickly see if your code contains unused or missing imports, watch the 
error stripes in the righthand margin: orange stripes mark missing or unused 
imports.
- 
+//TODO 04-This link doesn't work
 
-[.feature]
---
-image::images/onsave-small.png[role="left", link="images/onsave.png"]
---
+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.
 
+You can specify that, whenever you save a file, all the unused imports should 
automatically be removed, select:
 
-You can specify that whenever you save a file, all the unused imports should 
automatically be removed.
+[horizontal]
+*Windows*(TM)/*Linux*:: Select Tools > Options > Editor > On Save
+*macOS*(TM):: NetBeans > Preferences... > Editor > On Save
 
-Select Tools > Options > Editor > On Save.
+then for *Language: Java*, select the *Remove Unused Imports* checkbox.
 
-Select Java from the Language drop-down.
+//======================================================= Managing Imports 
(End)
 
-Check the Remove Unused Imports checkbox.
+//====================================================== Generating Code 
(Start)
 
- 
 == Generating Code
 
-When working in the Java Editor, you can generate pieces of code in one of the 
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.
+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.
 
+//==============================================================================
 
 === Using the Code Generation Dialog Box
 
-image::images/codegeneration1.png[]
+In the editor, you can automatically generate: various constructs, whole 
methods, override and delegate methods, add properties and more. To invoke code 
generation, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*::  `Alt-Insert`
+*macOS*(TM):: `Ctrl-I`
 
+or, choose *Source > Insert Code...* from the menu bar or, right-click and 
select *Insert Code...* anywhere in the editor to insert a construct from the 
Code Generation box. The suggested list is adjusted to the current context.
 
-Press  ``Alt-Insert``  (or choose Source > Insert Code) anywhere in the Editor 
to insert a construct from the Code Generation box. The suggested list is 
adjusted to the current context.
+In the example below, we are going to generate a constructor for the  
`ColorChooser`  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.
 
-In the example on the left, we are going to generate a constructor for the  
``ColorChooser``  class. Press  ``Alt-Insert`` , 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.
+image::images/codegeneration1.png[]
 
-In the IDE's Java Editor, you can automatically generate various constructs 
and whole methods, override and delegate methods, add properties and more.
+//==============================================================================
 
- 
 === Using Code Completion
 
+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.
+
 image::images/codegeneration2.png[]
 
-You can also generate code from the code completion window. In this example, 
we use the same piece of code as above to show how you can generate code from 
the code completion window.
+Press `Ctrl-Space` to open the code completion window and choose the following 
item:  `ColorChooser(String name, int number) - generate`. The editor generates 
a constructor with the specified parameters.
+
+In the code completion window, the constructors that can be generated 
automatically  are marked with the image:images/newconstructor.png[] icon and 
the " `generate` " note.
+
+For more explanation of the icons and their meanings, see <<Appendix A: Icons 
in the Code Completion Window>>.
 
-Press Ctrl-Space to open the code completion window and choose the following 
item:  ``ColorChooser(String name, int number) - generate`` . The Editor 
generates a constructor with the specified parameters.
+//TODO 05-This link doesn't work
 
-In the code completion window, the constructors that can be automatically 
generated are marked with the image:images/newconstructor.png[] icon and the " 
``generate`` " note. For more explanations of the icons and their meanings, see 
<<appendixa,Appendix A>>.
+//======================================================== Generating Code 
(End)
+
+//======================================================= Code Templates 
(Start)
 
- 
 == Code Templates
 
-A Code Template is a predefined piece of code that has an abbreviation 
associated with it. See the examples below that show how you can use code 
templates.
+A Code Template is a predefined piece of code that has an abbreviation 
associated with it.
 
+//==============================================================================
 
 === Using Code Templates
 
+Code templates are marked with the image:images/codetemplateicon.png[] icon in 
the code completion window.
+
 image::images/livetemplate.png[]
 
-Code templates are marked with the image:images/codetemplateicon.png[] icon in 
the code completion window.
+You can use code templates by selecting one from the code completion window or,
+by typing its abbreviation, found by selecting:
 
-You can do one of the following:
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Code Templates
+*macOS*(TM):: NetBeans > Preferences... > Editor > Code Templates
 
-* Select a template from the code completion window and press Enter or
-* Type the abbreviation for this template and press the key that expands this 
template (by default,  ``Tab`` ).
+and then *Language: Java* in the *Code Templates* pane.
 
-In the expanded template, editable parts are displayed as blue boxes. Use the  
``Tab``  key to go through the parts that you need to edit.
+The template can be expanded by pressing the default expansion key  `Tab`. In 
the expanded template, editable parts are displayed as blue boxes. Use the  
`Tab` key again to go through the parts that you need to edit.
+
+//==============================================================================
 
- 
 === Adding or Editing Code Templates
 
-[.feature]
---
-image::images/templateoptions-small.png[role="left", 
link="images/templateoptions.png"]
---
+To add or edit code templates, select:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Code Templates
+*macOS*(TM):: NetBeans > Preferences... > Editor > Code Templates
+
+then select *Language: Java*. In the *Templates:* window you will be pesented 
with a list of abbreviations each with an expanded text and description.
 
+Use the *New* and *Remove* buttons to modify the templates list. To edit an 
existing template, select the template and edit the code in the *Expanded Text* 
field. Then ideally, you should add a *Description* as an aid memoir and, if 
necessary, a *Context*.
 
-To customize Code Templates:
+Choose your peferred key from the *Expand Template on:* list, to activate your 
template. The default key is  `Tab` . Finally, select an action from the *On 
Template Expansion:* list.
 
-1. Choose Tools > Options > Editor > Code Templates.
-2. From the Language drop down list, select Java (or whichever language you 
want to create a code template for). The list of abbreviations and associated 
templates is displayed.
-3. Use the New and Remove buttons to add or remove templates in the list. To 
edit an existing template, select the template and edit the code in the 
Expanded Text field below the list.
-4. Choose the key which will be used to expand the templates. The default key 
is  ``Tab`` .
+See link:../php/code-templates.html[+Code Templates in NetBeans IDE for PHP+], 
for more information about templates.
 
-See 
link:http://wiki.netbeans.org/Java_EditorUsersGuide#How_to_use_Code_Templates[+this
 document+] to know more about the syntax for writing new Code Templates.
+//========================================================= Code Templates 
(End)
 
-See also link:../php/code-templates.html[+Code Templates in NetBeans IDE for 
PHP+].
+//================================================= Working with Javadoc 
(Start)
 
- 
 == Working with Javadoc
 
-Use the following features that facilitate working with Javadoc for your code.
+Use the following features to facilitate working with Javadoc for your code.
 
+//==============================================================================
 
 === Displaying Javadoc
 
+To display Javadoc, place the cursor on an element in your code and, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*::  `Ctrl-Shift-Space`
+*macOS*(TM):: `Command-Shift-\`
+
+or choose *Source > Show Documentation* from the menu bar. The Javadoc for 
this element is displayed in a popup window.
+
 image::images/javadoc.png[]
 
-Place the cursor on an element and press  ``Ctrl-Shift-Space (or choose Source 
> Show Documentation)`` . The Javadoc for this element is displayed in a popup 
window.
+From the menu bar, select *Window > IDE Tools > Javadoc Documentation* to open 
the Javadoc window, in which the documentation is refreshed automatically for 
the location of your cursor.
 
-In the IDE's main menu, click Window > IDE Tools > Javadoc Documentation to 
open the Javadoc window, in which the documentation is refreshed automatically 
for the location of your cursor.
+//==============================================================================
 
 === Creating Javadoc Stubs
 
-image::images/javadoc1.png[] 
+Place the cursor above a method or a class that has no Javadoc, type  `"/**` 
", and press  `Enter` .
 
-Place the cursor above a method or a class that has no Javadoc, type  ``"/**`` 
", and press  ``Enter`` .
+image::images/javadoc1.png[]
 
 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.
 
+//==============================================================================
+
 === Using Javadoc Hints
 
-image::images/javadoc2.png[] 
+The editor displays hints when Javadoc is missing or Javadoc tags are needed 
by displaying the bulb icon  image:images/bulb.png[] in the left-hand margin, 
click the bulb icon to fix Javadoc errors.
+
+image::images/javadoc2.png[]
+
+If you do not want to see the hints related to Javadoc, select:
 
-The IDE displays hints when Javadoc is missing or Javadoc tags are needed.
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Hints
+*macOS*(TM):: NetBeans > Preferences... > Editor > Hints
 
-Click the bulb icon on the lefthand margin of the editor to fix Javadoc errors.
+and clear the *JavaDoc* checkbox in the list of hints that are displayed.
 
-If you do not want to see the hints related to Javadoc, choose Tools > Options 
> Editor > Hints, and clear the Javadoc checkbox in the list of hints that are 
displayed.
+//==============================================================================
 
- 
 === Using Code Completion for Javadoc Tags
 
+Code completion is available for Javadoc tags.
+
 image::images/javadoc3.png[]
 
-Code completion is available for Javadoc tags.
+Type the `@` symbol and wait until the code completion window opens, depending 
on your settings, you may need to press  `Ctrl-Space`. Then select the required 
tag from the drop-down list.
 
-Type the "@" symbol and wait until the code completion window opens (depending 
on your settings, you may need to press  ``Ctrl-Space`` ).
+//==============================================================================
 
- 
 === Generating Javadoc
 
+To generate Javadoc for a project, select *Run > Generate Javadoc* from the 
menu bar or,  right-click the project in the *Projects* window and choose 
Generate Javadoc. The IDE will generate the Javadoc and open it in a separate 
browser window.
+
 image::images/generate.png[]
 
-To generate Javadoc for a project, choose Run > Generate Javadoc menu item (or 
right-click the project in the Projects window and choose Generate Javadoc). 
The IDE will generate the Javadoc and open it in a separate browser window.
+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.
 
-In the example on the left, 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.
+To customize Javadoc formatting options, right-click the project in the 
*Projects* window, choose *Properties* and open the *Documenting* panel under 
the *Build* category. This is only available for Java projects.
 
-To customize Javadoc formatting options, right-click the project, choose 
Properties and open the Documenting panel under the Build category (available 
on Java projects only). For information about the options on this panel, click 
the Help button in this window.
+//==============================================================================
 
- 
 === Analyzing Javadoc
 
-image::images/analyze-javadoc.png[]
+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.
 
-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.
+image::images/analyze-javadoc.png[]
 
 To analyze and fix Javadoc comments:
 
-1. Select a project, a package, or an individual file and choose Tools > 
Analyze Javadoc from the main menu. The Analyzer window displays suggestions 
for adding or fixing Javadoc comments, depending on the scope of your selection.
-2. Select one or several checkboxes where you would like to fix Javadoc and 
click the Fix Selected button. 
-3. Click Go Over Fixed Problems and use the Up and Down arrows to actually add 
your comments. This might be helpful if you selected to fix several instances 
at once and now want to revisit the stubs.
- 
-== Using Hints
+Select a project, a package, or an individual file and choose *Tools > Analyze 
Javadoc* from the menu bar. The *Analyzer* window displays suggestions for 
adding or fixing Javadoc comments, depending on the scope of your selection.
 
-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.
+Select one or, several checkboxes where you would like to fix Javadoc and 
click the *Fix Selected* button.
 
-=== Using Hints to Fix Code
+Click *Go Over Fixed Problems* 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.
 
-image::images/quickfixes.png[]
+//=================================================== Working with Javadoc 
(End)
 
-For the most common coding mistakes, you can see hints in the lefthand 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.
+//========================================================== Using Hints 
(Start)
 
-Hints are displayed automatically by default. However, if you want to view all 
hints, choose Source > Fix Code (or press Alt-Enter).
+== Using Hints
 
-For example, try typing "myBoolean=true". The editor detects that this 
variable is not defined. Click the hint icon and see that the Editor suggests 
that you create a field, a method parameter, or a local variable. Select
+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.
 
-=== Customizing Hints
+//==============================================================================
 
-[.feature]
---
-image::images/customizehints-small.png[role="left", 
link="images/customizehints.png"]
---
+=== Using Hints to Fix Code
 
-You might want to limit the number of categories for which hints are 
displayed. To do this:
+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.
 
-1. Choose Tools > Options > Editor > Hints.
-2. From the Language drop-down list, select Java and view a list of elements 
for which hints are displayed (their checkboxes are selected).
-3. To disable hints for some categories, clear the appropriate checkboxes.
+Hints are displayed automatically by default. However, if you want to view all 
hints, choose *Source > Fix Code* from the menu bar or, press:
 
-NOTE: On the Hints tab, you can also disable or limit the scope of dependency 
scans (Dependency Scanning option). These steps can significantly improve the 
performance of the IDE.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Enter`
+*macOS*(TM):: `Ctrl-Enter`
 
-The IDE detects 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 opened in the editor). When a 
compilation error is found, red badges are added to source file, package, or 
project nodes. Dependency scanning within projects can be resource consuming 
and degrade performance, especially if you are working with large projects.
+For example, try typing `myBoolean=true`. The editor detects that this 
variable is not defined. Click the hint icon image:images/bulberror1.png[] and, 
see the editor suggests that you create a field, a method parameter, or a local 
variable.
 
-To improve IDE's performance, you can do one of the following:
+image::images/quickfixes.png[]
+
+//==============================================================================
 
-* Limit the scope of dependency scans to the Source Root (search for 
dependencies only in the source root where the modified class is located) or 
current Project.
-* Disable dependency scanning (choose Project Properties > Build > Compiling 
and deselect the Track Java Dependencies option). In this case, the IDE does 
not scan for dependencies or updates the error badges when you modify a file.
- 
 === Surround With...
 
+You can easily surround pieces of your code with various statements, such as  
`for`,  `while`,  `if`,  `try/catch`, etc.
+
+Select a block in your code that you want to surround with a statement and 
click the bulb icon image:images/bulb.png[] in the left-hand margin or, choose 
*Source > Fix Code* from the menu bar or, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Enter`
+*macOS*(TM):: `Ctrl-Enter`
+
+The editor displays a pop-up list of suggestions from which you can select the 
statement you need.
+
 image::images/surroundwith.png[]
 
-You can easily surround pieces of your code with various statements, such as  
``for`` ,  ``while`` ,  ``if`` ,  ``try/catch`` , and other.
+//==============================================================================
 
-Select a block in your code that you want to surround with a statement and 
click the bulb icon in the lefthand margin (or press Alt-Enter). The editor 
displays a list of suggestions from which you select the statement you need.
+=== Customizing Hints
 
+You might want to limit the number of categories for which hints are 
displayed. To do this, select:
 
-== General Editor Features
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Editor > Hints
+*macOS*(TM):: NetBeans > Preferences... > Editor > Hints
 
+then select *Language: Java* 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.
 
-=== Code Formatting
+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 *Projects* window.
 
-[.feature]
---
-image::images/formatting-small.png[role="left", link="images/formatting.png"]
---
+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:
 
-Choose Source > Format or press  ``Alt-Shift-F``  to format the entire file or 
a selection of code. The IDE formats the code in accordance with the specified 
formatting settings.
+* On the Hints tab, you can disable dependency scans, via the *Dependency 
Scanning* option.
 
-To customize the formatting settings for Java code:
+* For a specific Project, in the *Projects* window select *Properties > Build 
> Compiling* and deselect the *Track Java Dependencies* option. In this case, 
the IDE does not scan for dependencies or update the error badges when you 
modify a file.
 
-1. Choose Tools > Options > Editor > Formatting.
-2. From the Language drop-down list, select Java.
-3. From the Category drop-down list, select the category that you would like 
to customize. For example, you can customize the number of blank lines, the 
size of tabs and indentation, wrapping style, etc.
-4. Modify the rules for the selected category and preview the result.
- 
-=== Inserting and Highlighting Braces, Brackets, and Quotes
+//============================================================ Using Hints 
(End)
+
+//=================================== Semantic Coloring and Highlighting 
(Start)
+
+== Semantic Coloring and Highlighting
 
-image::images/braces.png[]
+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 elements [...]
 
-By default, the IDE automatically inserts matching pairs of braces, brackets, 
and quotes. When you type an opening curly brace and then press  ``Enter`` , 
the closing brace is added automatically. For  ``(`` ,  ``[`` ,  ``"`` , and  
``'`` , the editor inserts a matching pair right away.
+//==============================================================================
 
-If, for some reason, this feature is disabled, enable it as follows:
+=== Customizing Colors
 
-1. Choose Tools > Options > Editor > Code Completion.
-2. Select the Insert Closing Brackets Automatically checkbox.
+The IDE provides several preset coloring schemes, which are called profiles. 
You can create new profiles with custom colors and quickly switch between them.
 
-The editor also highlights matching pairs of braces, brackets and quotes. For 
example, place the cursor before any brace or bracket and, if it has a matching 
pair, both will be highlighted in yellow. Single brackets of any type are 
highlighted in red and the error mark is displayed in the lefthand margin.
+To customize semantic coloring settings for the Java editor, select:
 
-To customize the highlight colors, choose Tools > Options > Editor > 
Highlighting.
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options > Fonts & Colors
+*macOS*(TM):: NetBeans > Preferences... > Fonts & Colors
 
-=== Code Folding
+It is preferable to save custom colors in new profiles, to do this use the  
following method:
 
-image::images/code-folded2.png[]
+* In the *Fonts & Colors* window, select a suitable profile from the 
*Profile:* drop-down list as your starting point.
+*  Click *Duplicate* next to the *Profile:* and, enter a name for your new 
profile and click *OK*.
+* Ensure that your new profile is currently selected *Profile: 
<myNewColorProfile>* and select *Language: Java*.
+* Select a *Category:* and then change the *Font:*, *Foreground:*, 
*Background:*, and *Effects:* for this category. Use the *Preview:* window to 
view the results and when satisfied click *OK*.
 
-In the Java Editor, you can quickly collapse and expand blocks of code, such 
as method declaration, Javadoc comments, import statements, etc. Collapsible 
blocks are shown with gray lines and plus/minus signs near the lefthand margin 
of the editor.
+NOTE: All NetBeans IDE settings and profiles are stored in the _NetBeans 
userdir_. When upgrading NetBeans, you can export your old settings and import 
them into the new version.
 
-* The easiest way to collapse a block of code is to click the gray lines with 
a minus character in the lefthand margin.
-* The number of lines within the collapsed block are shown, as well as the 
first line of a collapsed block of Javadoc comments.
-* To fold all collapsible blocks in a file, right-click in the editor and 
choose Code Folds > Collapse All from the pop-up menu.
-* From the Code Folds > Collapse All pop-up menu, you can choose to collapse 
all Javadoc comments or all Java code in a file.
-* You can mouse over the folded elements to quickly review the hidden parts.
+//==============================================================================
 
-To customize the code folding options:
+=== Exporting and Importing Settings
 
-1. Choose Tools > Options > Editor > Folding.
-2. To disable code folding, clear Enable Code Folding. Note that code folding 
is enabled by default.
-3. Select the blocks of code to be collapsed by default when you open a file.
- 
-=== Customizing Keyboard Shortcuts
+To export IDE settings, select:
 
-[.feature]
---
-image::images/keyboard-small.png[role="left", link="images/keyboard.png"]
---
+[horizontal]
+*Windows*(TM)/*Linux*:: Tools > Options
+*macOS*(TM):: NetBeans > Preferences...
 
-In the NetBeans IDE, choose Tools > Options > Keymap to customize keyboard 
shortcuts. You can do this in several ways:
+and click *Export*, specify the location and name of the ZIP file that will be 
created. Select the settings that you want to export and click *OK*.
 
-* Select a predefined set of keyboard shortcuts, which is called Profile.
-* Edit particular keyboard shortcuts.
+To import IDE settings:
 
-You can save customized sets of your shortcuts as profiles. Then, you can 
switch from one profile to another to quickly change multiple settings. For 
example, to create a custom profile of keyboard shortcuts:
+Open the *Options/Preferences...* window and click *Import*. Specify the 
location of the ZIP file to import and then select the settings you want to 
import and click *OK*.
 
-1. In the Options > Keymap window, click Manage profiles.
-2. Select the profile you want to use as a base for your new profile and click 
Duplicate.
-3. Enter the new profile name and click OK.
-4. Ensure that the new profile is selected and modify the shortcuts you need.
-To edit a shortcut, double-click in the Shortcut field or click the ellipsis 
button (...). As you press the sequence of keys, the syntax for them is added. 
-If you want to add special characters, such as  ``Tab`` ,  ``Escape`` , or  
``Enter`` , click the ellipsis button (...) again and select the key from the 
pop-up window.
-5. When finished editing, click OK in the Options window.
+//==============================================================================
 
-To find a shortcut for a specific command, type the command name in the Search 
field. To find a command by a combination, insert the cursor in the Search in 
Shortcuts field and press the shortcut key combination.
+=== Coloring Example
 
-== Semantic Coloring and Highlighting
+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.
 
-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 places a [...]
+image::images/coloring.png[]
 
-=== Customizing Colors
+* Distinct colors are used for: keywords (blue), variables and fields (green), 
and parameters (orange).
 
-[.feature]
---
-image::images/coloringoptions-small.png[role="left", 
link="images/coloringoptions.png"]
---
+* 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.
 
-To customize semantic coloring settings for the Java Editor, choose Tools > 
Options > Fonts &amp; Colors.
+* Unused members are underlined with a gray wavy line.
 
-The IDE provides several preset coloring schemes, which are called profiles. 
You can create new profiles with custom colors and quickly switch between them.
+* Comments are displayed in gray.
 
-It is very convenient to save custom colors in new profiles. For example, do 
the following:
+//==============================================================================
 
-1. In the Options > Fonts &amp; Colors window, click Duplicate next to the 
Profile drop-down list.
-2. Enter the new profile name and click OK.
-3. Ensure that the new profile is currently selected and choose Java from the 
Language drop-down list.
-4. Select a category and change the font, font color (Foreground), background 
color, and effects for this category.  Use the Preview window to view the 
results.
-5. Click OK.
+=== Using Highlights
 
-NOTE: All NetBeans IDE settings and profiles are stored in the _NetBeans 
userdir_ (refer to the link:http://wiki.netbeans.org/FaqWhatIsUserdir[+FAQ+] on 
how to locate the _userdir_ for your operating system). When upgrading to newer 
versions of NetBeans, you can export old settings and import them to the newer 
version.
+image::images/highlightelement.png[]
 
-To export the IDE settings:
+The IDE highlights usages of the same element, matching braces, method exit 
points, and exception throwing points.
 
-1. In the Options window (Tools > Options), click Export.
-2. Specify the location and name of the ZIP file that will be created.
-3. Select the settings that you want to export and click OK.
+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 <<stripes,Error Stripes>>). Click the error stripe to quickly navigate to 
the desired usage location.
 
-To import the IDE settings:
+If you decide to rename all the highlighted instances, use the Instant Rename 
command (Ctrl-R or choose Refactor > Rename).
 
-1. In the Options window (Tools > Options), click Import.
-2. Specify the ZIP file with IDE settings or path to the _userdir_ from a 
previous version.
-3. Select the settings that you want to import and click OK.
+//===================================== Semantic Coloring and Highlighting 
(End)
 
+//=========================================================== Navigation 
(Start)
 
-=== Coloring Example
+== Navigation
 
-image::images/coloring.png[]
+The Java editor provides numerous ways to navigate through code. See below for 
several examples that show the navigation features of the Java editor.
 
-In the left, you can see an example of a coloring scheme. Depending on your 
custom settings, your colors might look differently than those shown in the 
screenshot.
+//==============================================================================
 
-Distinct colors are used for keywords (blue), variables and fields (green), 
and parameters (orange).
+=== Error Stripes
 
-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.
+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.
 
-Unused members are underlined with a gray wavy line. Comments are displayed in 
gray.
+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.
 
-=== Using Highlights
+//==============================================================================
 
-image::images/highlightelement.png[]
+=== Navigating From the Editor: Go to...
 
-The IDE highlights usages of the same element, matching braces, method exit 
points, and exception throwing points.
+There are many ways of navigating through your code, use the following the "Go 
to..." commands located under the *Navigate* menu to quickly jump to target 
locations:
 
-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 <<stripes,Error Stripes>>). Click the error stripe to quickly navigate to 
the desired usage location.
+Select: a class, method or field in your code and then choose your desired 
action:
 
-If you decide to rename all the highlighted instances, use the Instant Rename 
command (Ctrl-R or choose Refactor > Rename).
+*Go to declaration*, press:
 
-== Navigation
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-B`
+*macOS*(TM):: `Ctrl-Shift-G`
 
-The Java Editor provides numerous ways of how you can navigate through code. 
See below for several examples that show the navigation features of the Java 
Editor.
+or, select *Navigate > Go to Declaration* from the menu bar or, right-click 
and select *Navigate > Go To Declaration* 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.
 
+*Go to source*, press:
 
-=== Error Stripes
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Shift-B`
+*macOS*(TM):: `Command-Shift-B`
 
-Error stripes in the righthand margin of the editor provide a quick overview 
of all marked places in the current file: errors, warnings, hints, highlighted 
occurrences, and annotations. Note that the error stripe margin represents an 
entire file, not just the part that is currently displayed in the editor. By 
using error stripes, you can immediately identify whether your file has any 
errors or warnings, without scrolling through the file.
+or, select *Navigate > Go to Source* from the menu bar or, right-click and 
select *Navigate > Go to Source* 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".
 
-Click an error stripe to jump to the line that the mark refers to.
+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.
 
+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.
 
-=== Navigating From the Editor: Go To...
+*Go to type*, press:
 
-image::images/gotodeclaration.png[]
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-O`
+*macOS*(TM):: `Command-O`
 
-Use the following the "Go To.." commands located under the Navigate menu item 
to quickly jump to target locations:
+or, select *Navigate > Go to Type...* from the menu bar.
 
-* *Go To Declaration (Ctrl-B, by default)*. Hold down the Ctrl key and click 
the usage of a class, method, or field to jump to its declaration. You can also 
place the cursor on the member (a class, method, or field) and choose Navigate 
> Go To Declaration or right-click and choose Navigate > Go To Declaration from 
the pop-up menu.
-* *Go To Source (Ctrl-Shift-B, by default)*. Hold down the Ctrl key and click 
a class, method, or field to jump to the source code, if the source is 
available. You can also place the cursor on the member (a class, method, or 
field) and either press Ctrl-Shift-B or choose Navigate > Go To Source in the 
main menu.
- 
 image::images/gototype.png[]
 
-* *Go To Type (Ctrl-O)*, *Go To File (Alt-Shift-O),* and *Go To Symbol 
(Ctrl-Alt-Shift-O)*. 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.
- 
+*Go to file*, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Shift-O`
+*macOS*(TM):: `Ctrl-Shift-O`
+
+or, select *Navigate > Go to File...* from the menu bar.
+
+*Go to symbol*, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Alt-Shift-O`
+*macOS*(TM):: `Ctrl-Shift-Command-O`
+
+or, select *Navigate > Go to Symbol...* from the menu bar.
+
+*Go to line*, press `Ctrl-G` or, select *Navigate > Go to Line* from the menu 
bar, and enter the line number to which you want to jump.
+
 image::images/gotoline.png[]
 
-* *Go To Line (Ctrl-G)*. Enter the line number to which you want to jump.
-* *Go To Bookmark (Ctrl-G Ctrl-G)*. Enables you to jump to a bookmark based on 
a key assigned to it in the Bookmarks window. (See the <<bookmarks,Bookmarks>> 
section for details.)
- 
+//==============================================================================
+
 === Jumping to Last Edit
 
+To quickly return to your last edit, even if it is in another file or project, 
press `Ctrl-Q` 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.
+
 image::images/jumplastedit.png[]
 
-To quickly return to your last edit, even if it is in another file or project, 
press Ctrl-Q 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.
+//==============================================================================
 
- 
 === Using Breadcrumbs
 
+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 *View > Show Breadcrumbs* from the menu bar.
+
 image::images/breadcrumbs.png[]
 
-Breadcrumbs are shown along the bottom of the editor.
+Click on an arrow associated with a breadcrumb to see all available class 
members and select to jump to them.
 
-The place where the cursor is found in the document determines the breadcrumbs 
displayed.
+//==============================================================================
 
-Show/hide breadcrumbs from View | Show Breadcrumbs.
+=== Switching Between Files
 
-Click on an arrow associated with a breadcrumb to see all available class 
members and select to jump to them.
+There are several features that allow you to switch between open files:
 
- 
-=== Switching Between Files
+To go to a previously edited file, press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Left`
+*macOS*(TM):: `Ctrl-Left`
+
+or, select *Navigate > Back*, from the menu bar.
+
+To move forward press:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Alt-Right`
+*macOS*(TM):: `Ctrl-Right`
+
+or, select *Navigate > Forward*, from the menu bar.
+
+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.
 
 image::images/jumprecentfile.png[]
 
- 
-There are two very handy features that allow you to switch between open files:
+* You can toggle between files and windows by pressing `Ctrl-Tab`. After you 
press `Ctrl-Tab`, 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 `Ctrl` key then press and release the `Tab` key to move 
forward  through the list. Hold down `Ctrl-Shift` then press and release the 
`Tab` key to move backward through the list. When your required file is 
highlighted release all keys to  [...]
 
-* *Go Back (Alt-Left)* and *Go Forward (Alt-Right).* To go to the previously 
edited file or move forward, choose Navigate < Back or Navigate < Forward or 
press the corresponding buttons on the editor toolbar (shown in the figure). 
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.
- 
+NOTE: If you continue pressing the `Tab` key you will also cycle through the 
windows list as well.
 
 image::images/togglefile.png[]
 
-* *Toggle Between Files (Ctrl-Tab)*. After you press Ctrl-Tab, all open files 
are shown in a pop-up window. Hold down the Ctrl key and press several times 
the Tab key to choose the file you would like to open.
- 
+* You can show all open documents by pressing, `Shift-F4` or, select *Windows 
> Documents...* from the menu bar. After you have selected the *Documents* 
window, all open files are shown. Order the files based on your needs and 
choose the file you would like to open.
 
 image::images/shift-f4.png[]
 
-* *Show Open Documents (Shift-F4)*. After you press Shift-F4, all open files 
are shown in the Documents window. Order the files based on your needs and 
choose the file you would like to open.
- 
+//==============================================================================
+
 === Using Bookmarks
 
+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:
+
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Shift-M`
+*macOS*(TM):: `Command-Shift-M`
+
+or, select *Navigate > Toggle Bookmark* from the menu bar or, right-click the 
left margin and choose *Bookmark > Toggle Bookmark*.
+
+Alternatively, you can select *View > Show Editor Toolbar* 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: *Previous Bookmark*, *Next Bookmark* and *Toggle Boomark*
+
+A bookmarked line is shown with a small blue icon in the left margin, as shown 
below.
+
 image::images/bookmark.png[]
 
-You can use bookmarks to quickly navigate through certain places in your code.
+To remove the bookmark, press the key combination again.
 
-Press Ctrl-Shift-M (or right-click the left margin and choose Bookmark > 
Toggle Bookmark) to bookmark the current line. The bookmarked line is shown 
with a small blue icon in the left margin (see the figure).
+To clear all document bookmarks, you need to customize the Toolbar, to do this 
select *View > Toolbars > Customize*. In the pop-up window scroll down to 
category *Edit* and, if necessary expand it, then drag the *Clear Document 
Bookmarks* icon to your toolbar.
 
-To remove the bookmark, press Ctrl-Shift-M again.
+To go to the next bookmark, press:
 
-image::images/bookmark2.png[]
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Shift-Period`
+*macOS*(TM):: `Command-Shift-Period`
+
+To go to the previous bookmark, press:
 
-To go to the next bookmark, press Ctrl-Shift-Period, to go to the previous 
bookmark, press Ctrl-Shift-Comma.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-Shift-Comma`
+*macOS*(TM):: `Command-Shift-Comma`
+
+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.
+
+image::images/bookmark2.png[]
 
-Automatically a popup appears, letting you move forward and backward via 
Ctrl-Shift-Period and Ctrl-Shift-Comma.
+You can move forward or backward by repeatedly releasing and pressing the 
`Period` key or `Comma` 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.
 
-Release the keyboard to select the current item in the list, which will cause 
the editor to open the file at the line where the bookmark is found.
+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.
 
- 
-[.feature]
---
-image:images/bookmark3-small.png[role="left", link="images/bookmark3.png"]
---
+If you select the *<Bookmarks>* item in the pop-up list, as shown in the 
figure above or, when you select *Window > IDE Tools > Bookmarks* from the menu 
bar, the *Bookmarks* window opens.
 
-You can view all bookmarks throughout all your projects and manage them.
+image::images/bookmark3-small.png[]
 
-When the <Bookmarks> item is selected in the popup shown above or when Window 
| IDE Tools | Bookmarks is selected, the Bookmarks window opens.
+The *Bookmarks* 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.
 
-Two views are provided for viewing bookmarks and you can view the related code 
in a preview window.
+In the bookmarks pane you can select either a *Tree View* or, a *Table View*. 
In *Table View* you can assign keys and labels to bookmarks, so that when  
`Ctrl-G`  is pressed, you can quickly jump to a labelled bookmark in your code.
 
-In the Table view, you can assign keys to bookmarks so that when  ``Ctrl-G``  
is pressed twice, you can quickly jump to a bookmark in your code.
+//==============================================================================
 
- 
 === Using the Navigator
 
+The Navigator window provides structured views of the file you are working 
with and lets you quickly navigate between different parts of the file.
+
 image::images/navigatorwindow.png[]
 
-The Navigator window provides structured views of the file you are working 
with and lets you quickly navigate between different parts of the file.
+To open the Navigator window, choose *Window > Navigator* or, press:
 
-To open the Navigator window, choose Window > Navigator or press Ctrl-7.
+[horizontal]
+*Windows*(TM)/*Linux*:: `Ctrl-7`
+
+NOTE: There is no keyboard shortcut set for *macOS*(TM). See *Customizing 
Keyboard Shortcuts* to learn how to set missing shortcuts.
 
 In the Navigator window, you can do the following:
 
 * Choose between different views: Members, Bean Patterns, Trees, Elements, etc.
 * Double-click an element to jump to the line where it is defined.
 * Right-click an element and apply commands, such as Go to Source, Find 
Usages, and Refactor.
-* Apply filters to the elements displayed in the Navigator (use the buttons at 
the bottom).
-* Type the name of the element that you want to find (the Navigator window 
must be active).
-
-image::images/navigatorwindow2.png[]
+* Apply filters to the elements displayed in the *Navigator*, select the 
buttons at the bottom.
+* Type the name of the element that you want to find, the *Navigator* window 
must be active.
 
-When the Navigator is active, type the name of the element that you want to 
find.
 
-Matching items are highlighted.
+//============================================================= Navigation 
(End)
 
-You can move to matching items by pressing the Up and Down arrow keys.
+//=========================================================== Appendix A 
(Start)
 
 == Appendix A: Icons in the Code Completion Window
 
@@ -687,56 +887,55 @@ You can move to matching items by pressing the Up and 
Down arrow keys.
 |===
 |Icon |Meaning |Variants (if any) | Meaning
 
+|image:images/annotation_type.png[] |Annotation type |  |
 
-|image:images/annotation_type.png[] |Annotation type |  |  
-
-|image:images/class_16.png[] |Class |  |  
+|image:images/class_16.png[] |Class |  |
 
-|image:images/package.png[] |Package |  |  
+|image:images/package.png[] |Package |  |
 
-|image:images/enum.png[] |Enum type |  |  
+|image:images/enum.png[] |Enum type |  |
 
-|image:images/code_template.png[] |Code Template |  |  
+|image:images/code_template.png[] |Code Template |  |
 
-|image:images/constructor_16.png[] |Constructor 
|image:images/new_constructor_16.png[] |New constructor (generate) 
+|image:images/constructor_16.png[] |Constructor 
|image:images/new_constructor_16.png[] |New constructor (generate)
 
-|  |  |image:images/constructor_protected_16.png[] |Protected constructor 
+|  |  |image:images/constructor_protected_16.png[] |Protected constructor
 
-|  |  |image:images/constructor_private_16.png[] |Private constructor 
+|  |  |image:images/constructor_private_16.png[] |Private constructor
 
-|  |  |image:images/constructor_package_private_16.png[] |Package private 
constructor 
+|  |  |image:images/constructor_package_private_16.png[] |Package private 
constructor
 
-|image:images/field_16.png[] |Field |image:images/field_protected_16.png[] 
|Protected field 
+|image:images/field_16.png[] |Field |image:images/field_protected_16.png[] 
|Protected field
 
-|  |  |image:images/field_private_16.png[] |Private field 
+|  |  |image:images/field_private_16.png[] |Private field
 
-|  |  |image:images/field_package_private_16.png[] |Package private field 
+|  |  |image:images/field_package_private_16.png[] |Package private field
 
-|image:images/field_static_16.png[] |Static field 
|image:images/field_static_protected_16.png[] |Protected static field 
+|image:images/field_static_16.png[] |Static field 
|image:images/field_static_protected_16.png[] |Protected static field
 
-|  |  |image:images/field_static_private_16.png[] |Private static field 
+|  |  |image:images/field_static_private_16.png[] |Private static field
 
-|  |  |image:images/field_static_package_private_16.png[] |Package private 
static field 
+|  |  |image:images/field_static_package_private_16.png[] |Package private 
static field
 
-|image:images/interface.png[] |Interface |  |  
+|image:images/interface.png[] |Interface |  |
 
-|image:images/javakw_16.png[] |Java keyword |  |  
+|image:images/javakw_16.png[] |Java keyword |  |
 
-|image:images/method_16.png[] |Method |image:images/method_protected_16.png[] 
|Protected method 
+|image:images/method_16.png[] |Method |image:images/method_protected_16.png[] 
|Protected method
 
-|  |  |image:images/method_private_16.png[] |Private method 
+|  |  |image:images/method_private_16.png[] |Private method
 
-|  |  |image:images/method_package_private_16.png[] |Package private method 
+|  |  |image:images/method_package_private_16.png[] |Package private method
 
-|image:images/method_static_16.png[] |Static method 
|image:images/method_static_protected_16.png[] |Protected static method 
+|image:images/method_static_16.png[] |Static method 
|image:images/method_static_protected_16.png[] |Protected static method
 
-|  |  |image:images/method_static_private_16.png[] |Private static method 
+|  |  |image:images/method_static_private_16.png[] |Private static method
 
-|  |  |image:images/method_static_package_private_16.png[] |Package private 
static method 
+|  |  |image:images/method_static_package_private_16.png[] |Package private 
static method
 
-|image:images/localVariable.png[] |Local variable |  |  
+|image:images/localVariable.png[] |Local variable |  |
 
-|image:images/attribute_16.png[] |Attribute |  |  
+|image:images/attribute_16.png[] |Attribute |  |
 |===
 
- 
+//=============================================================== Appendix 
(End)
diff --git 
a/netbeans.apache.org/src/content/kb/docs/java/images/code-folded2a.png 
b/netbeans.apache.org/src/content/kb/docs/java/images/code-folded2a.png
new file mode 100644
index 0000000..0578753
Binary files /dev/null and 
b/netbeans.apache.org/src/content/kb/docs/java/images/code-folded2a.png differ


---------------------------------------------------------------------
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

Reply via email to