This is an automated email from the ASF dual-hosted git repository. vieiro 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 63c6d7a Removed tables 63c6d7a is described below commit 63c6d7ac874e3a7a2b771bd50819efe630efb417 Author: Antonio Vieiro <vie...@users.noreply.github.com> AuthorDate: Thu Jan 17 16:41:52 2019 +0100 Removed tables These tables are used for web page layout, not for semantic information, so they're removed. --- .../kb/docs/java/editor-codereference.asciidoc | 443 +++++---------------- 1 file changed, 101 insertions(+), 342 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 943d02a..cc10699 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 @@ -38,10 +38,11 @@ The NetBeans IDE's Java Editor helps you quickly complete and generate code thro ==== Invoking Code Completion -|=== - -|image:images/codecompletion3.png[] | +[.feature] +-- +image::images/codecompletion3.png[role="left"] +-- 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. @@ -56,19 +57,20 @@ When the Auto Popup Completion Window checkbox is disabled, you need to press ` 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. - -|image:images/codecompletion4.png[] | +[.feature] +-- +image::images/codecompletion4.png[role="right"] +-- 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. - -|=== - ==== Smart Suggestions at the Top -|=== -|image:images/smartcompletion1.png[] | +[.feature] +-- +image::images/smartcompletion1.png[role="left"] +-- 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. @@ -77,52 +79,48 @@ In the example on the left, the editor suggests inserting the ``LinkedHashMap`` If the "smart" suggestions are not the ones you want to use, press ``Ctrl-Space`` again to see the complete list, as shown above. -|=== - - ==== Camel Case Completion -|=== -|image:images/camelcase.png[] | +[.feature] +-- +image::images/camelcase.png[role="left"] +-- 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`` . -|=== - - ==== Completing Keywords -|=== -|image:images/keywords.png[] | +[.feature] +-- +image::images/keywords.png[role="left"] +-- 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 on the left, the ``ColorChooser`` class needs to extend the ``JPanel`` class. You can quickly add the keyword ``extends`` from the suggested items. - -|=== - ==== Suggesting Names for Variable and Fields -|=== -|image:images/names.png[] | +[.feature] +-- +image::images/names.png[role="left"] +-- 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. -|=== - - ==== Suggesting Parameters -|=== -|image:images/parameter.png[] | +[.feature] +-- +image::images/parameter.png[] +-- The editor guesses on the parameters for variables, methods, or fields and displays the suggestions in a pop-up box. @@ -131,13 +129,12 @@ For example, when you select a method from the code completion window which has You can invoke the tooltips with method parameters by pressing ``Ctrl-P`` (or Source > Show Method Parameters) at any time. -|=== - - ==== Common Prefix Completion -|=== -|image:images/prefixcompletion.png[] | +[.feature] +-- +image::images/prefixcompletion.png[] +-- You can use the ``Tab`` key to quickly fill in the most commonly used prefixes and single suggestions. @@ -146,13 +143,9 @@ 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 -|=== -|image:images/subcompletion.png[] | +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. @@ -160,75 +153,56 @@ Sometimes you may not remember how an items starts, making it difficult to use c 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 -|=== -|image:images/chain.png[] | +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[] | +image::images/static.png[] 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. 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. -|=== - - ==== Excluding Items from Completion -|=== -|image:images/exclude2-small.png[] | +[.feature] +-- +image::images/exclude2-small.png[role="left"] +-- 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. - - -|image:images/exclude.png[] | +[.feature] +-- +image:images/exclude.png[role="right"] +-- 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 -|=== -|image:images/jpacompletion.png[] | +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>> at the end of this document to see the meanings of these icons. -<<top,top>> - - === 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. -|=== -|image:images/imports3.png[] - - - - | +[.feature] +-- +image::images/imports3.png[role="left"] +-- 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. @@ -236,29 +210,28 @@ While you are typing, press ``Ctrl-Shift-I`` (or choose Source > Fix Imports f 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. - - -|image:images/imports.png[] | +[.feature] +-- +image::images/imports.png[role="left"] +-- 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). 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. - -|[.feature] +[.feature] -- -image:images/onsave-small.png[role="left", link="images/onsave.png"] +image::images/onsave-small.png[role="left", link="images/onsave.png"] -- - | + You can specify that whenever you save a file, all the unused imports should automatically be removed. @@ -269,11 +242,6 @@ Select Java from the Language drop-down. Check the Remove Unused Imports checkbox. -|=== - -<<top,top>> - - === 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. @@ -281,12 +249,8 @@ When working in the Java Editor, you can generate pieces of code in one of the t ==== Using the Code Generation Dialog Box -|=== -|image:images/codegeneration1.png[] - - +image::images/codegeneration1.png[] - | 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. @@ -295,13 +259,9 @@ In the example on the left, we are going to generate a constructor for the ``Co 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 -|=== -|image:images/codegeneration2.png[] | +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. @@ -310,11 +270,6 @@ Press Ctrl-Space to open the code completion window and choose the following ite 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>>. -|=== - -<<top,top>> - - === 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. @@ -322,10 +277,7 @@ A Code Template is a predefined piece of code that has an abbreviation associate ==== Using Code Templates -|=== -|image:images/livetemplate.png[] - - | +image::images/livetemplate.png[] Code templates are marked with the image:images/codetemplateicon.png[] icon in the code completion window. @@ -337,18 +289,13 @@ You can do one of the following: 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. -|=== - - ==== Adding or Editing Code Templates -|=== -|[.feature] +[.feature] -- -image:images/templateoptions-small.png[role="left", link="images/templateoptions.png"] +image::images/templateoptions-small.png[role="left", link="images/templateoptions.png"] -- - | To customize Code Templates: @@ -362,11 +309,6 @@ See link:http://wiki.netbeans.org/Java_EditorUsersGuide#How_to_use_Code_Template See also link:../php/code-templates.html[+Code Templates in NetBeans IDE for PHP+]. -|=== - -<<top,top>> - - === Working with Javadoc Use the following features that facilitate working with Javadoc for your code. @@ -374,42 +316,23 @@ Use the following features that facilitate working with Javadoc for your code. ==== Displaying Javadoc -|=== -|image:images/javadoc.png[] | +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. 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[] | +image::images/javadoc1.png[] Place the cursor above a method or a class that has no Javadoc, type ``"/**`` ", and press ``Enter`` . 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[] | +image::images/javadoc2.png[] The IDE displays hints when Javadoc is missing or Javadoc tags are needed. @@ -418,26 +341,18 @@ Click the bulb icon on the lefthand margin of the editor to fix Javadoc errors. 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 -|=== -|image:images/javadoc3.png[] | +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`` ). -|=== - - ==== Generating Javadoc -|=== -|image:images/generate.png[] | +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. @@ -446,37 +361,25 @@ In the example on the left, you can see a sample output of the Generate Javadoc 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[] | +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 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. +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. -|=== - -<<top,top>> - - === Using Hints 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. - ==== Using Hints to Fix Code -|=== -|image:images/quickfixes.png[] | +image::images/quickfixes.png[] 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. @@ -484,20 +387,13 @@ Hints are displayed automatically by default. However, if you want to view all h 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 - -|=== - - ==== Customizing Hints -|=== -|[.feature] +[.feature] -- -image:images/customizehints-small.png[role="left", link="images/customizehints.png"] +image::images/customizehints-small.png[role="left", link="images/customizehints.png"] -- - | - You might want to limit the number of categories for which hints are displayed. To do this: 1. Choose Tools > Options > Editor > Hints. @@ -513,35 +409,25 @@ To improve IDE's performance, you can do one of the following: * 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... -|=== -|image:images/surroundwith.png[] | +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. - -|=== - === General Editor Features ==== Code Formatting -|=== -|[.feature] +[.feature] -- -image:images/formatting-small.png[role="left", link="images/formatting.png"] +image::images/formatting-small.png[role="left", link="images/formatting.png"] -- - | - 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. To customize the formatting settings for Java code: @@ -551,15 +437,9 @@ To customize the formatting settings for Java code: 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 -|=== -|image:images/braces.png[] - - | +image::images/braces.png[] 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. @@ -572,16 +452,9 @@ The editor also highlights matching pairs of braces, brackets and quotes. For ex To customize the highlight colors, choose Tools > Options > Editor > Highlighting. - -|=== - - ==== Code Folding -|=== -|image:images/code-folded2.png[] - - | +image::images/code-folded2.png[] 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. @@ -597,19 +470,13 @@ To customize the code folding options: 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 -|=== -|[.feature] +[.feature] -- -image:images/keyboard-small.png[role="left", link="images/keyboard.png"] +image::images/keyboard-small.png[role="left", link="images/keyboard.png"] -- - | - In the NetBeans IDE, choose Tools > Options > Keymap to customize keyboard shortcuts. You can do this in several ways: * Select a predefined set of keyboard shortcuts, which is called Profile. @@ -627,12 +494,6 @@ If you want to add special characters, such as ``Tab`` , ``Escape`` , or ``En 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. - - - -|=== - - === Semantic Coloring and Highlighting 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 [...] @@ -640,14 +501,11 @@ The IDE's Java Editor shows code elements in distinct colors, based on the seman ==== Customizing Colors -|=== -|[.feature] +[.feature] -- -image:images/coloringoptions-small.png[role="left", link="images/coloringoptions.png"] +image::images/coloringoptions-small.png[role="left", link="images/coloringoptions.png"] -- - | - To customize semantic coloring settings for the Java Editor, choose Tools > Options > Fonts & Colors. The IDE provides several preset coloring schemes, which are called profiles. You can create new profiles with custom colors and quickly switch between them. @@ -657,8 +515,7 @@ It is very convenient to save custom colors in new profiles. For example, do the 1. In the Options > Fonts & 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. +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. 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. @@ -676,17 +533,9 @@ To import the IDE settings: 3. Select the settings that you want to import and click OK. - - -|=== - - ==== Coloring Example -|=== -|image:images/coloring.png[] - - | +image::images/coloring.png[] 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. @@ -697,17 +546,9 @@ References to deprecated methods or classes are shown as strikethrough. This war Unused members are underlined with a gray wavy line. Comments are displayed in gray. - - -|=== - - ==== Using Highlights -|=== -|image:images/highlightelement.png[] - - | +image::images/highlightelement.png[] The IDE highlights usages of the same element, matching braces, method exit points, and exception throwing points. @@ -716,11 +557,6 @@ If you place the cursor in an element, such as a field or a variable, all usages If you decide to rename all the highlighted instances, use the Instant Rename command (Ctrl-R or choose Refactor > Rename). - - -|=== - - === Navigation 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. @@ -735,57 +571,32 @@ Click an error stripe to jump to the line that the mark refers to. ==== Navigating From the Editor: Go To... -|=== -|image:images/gotodeclaration.png[] - - | +image::images/gotodeclaration.png[] Use the following the "Go To.." commands located under the Navigate menu item to quickly jump to target locations: * *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[] - - | +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. -|=== -|=== - -|image:images/gotoline.png[] - - | +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 -|=== -|image:images/jumplastedit.png[] - - | +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 -|=== -|image:images/breadcrumbs.png[] - - | +image::images/breadcrumbs.png[] Breadcrumbs are shown along the bottom of the editor. @@ -796,45 +607,28 @@ Show/hide breadcrumbs from View | Show Breadcrumbs. Click on an arrow associated with a breadcrumb to see all available class members and select to jump to them. -|=== - - ==== Switching Between Files -|=== -|image:images/jumprecentfile.png[] +image::images/jumprecentfile.png[] - - | - There are two very handy features that allow you to switch between open files: * *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. -|image:images/togglefile.png[] - - | +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. -|image:images/shift-f4.png[] - - | +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 -|=== -|image:images/bookmark.png[] - - | +image::images/bookmark.png[] You can use bookmarks to quickly navigate through certain places in your code. @@ -842,13 +636,7 @@ Press Ctrl-Shift-M (or right-click the left margin and choose Bookmark > Toggle To remove the bookmark, press Ctrl-Shift-M again. - -|=== -|=== - -|image:images/bookmark2.png[] - - | +image::images/bookmark2.png[] To go to the next bookmark, press Ctrl-Shift-Period, to go to the previous bookmark, press Ctrl-Shift-Comma. @@ -857,16 +645,11 @@ Automatically a popup appears, letting you move forward and backward via Ctrl-Sh 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. -|=== -|=== - -|[.feature] +[.feature] -- image:images/bookmark3-small.png[role="left", link="images/bookmark3.png"] -- - | - You can view all bookmarks throughout all your projects and manage them. When the <Bookmarks> item is selected in the popup shown above or when Window | IDE Tools | Bookmarks is selected, the Bookmarks window opens. @@ -876,15 +659,9 @@ Two views are provided for viewing bookmarks and you can view the related code i 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 -|=== -|image:images/navigatorwindow.png[] - - | +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. @@ -898,15 +675,7 @@ In the Navigator window, you can do the following: * 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[] - - | +image::images/navigatorwindow2.png[] When the Navigator is active, type the name of the element that you want to find. @@ -915,29 +684,19 @@ Matching items are highlighted. You can move to matching items by pressing the Up and Down arrow keys. -|=== - - -link:/about/contact_form.html?to=3&subject=Feedback:%20Code%20Assistance%20in%20the%20NetBeans%20IDE%20Java%20Editor%20for%208.0[+Send Feedback on This Tutorial+] - - === See Also * link:https://netbeans.org/features/java/editor.html[+Editing and Refactoring Features in NetBeans IDE+] * link:https://netbeans.org/kb/trails/java-se.html[+General Java Development Learning Trail+] * link:https://netbeans.org/projects/usersguide/downloads/download/shortcuts-80.pdf[+Highlights of NetBeans IDE Keyboard Shortcuts & Code Templates+] -<<top,top>> - === Appendix A: Icons in the Code Completion Window +[cols="1,3,1,3"] |=== -|Icon |Meaning |Variants (if any) | +|Icon |Meaning |Variants (if any) | Meaning -Meaning - - |image:images/annotation_type.png[] |Annotation type | | --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists