# Java editor

The following Java editor preferences can be set on this page:

- Appearance
- Syntax
- Code Assist
- Problem Indication

## Appearance

Appearance specifies the Java editor's appearance.

Appearance
Option | Description | Default
--- | --- | ---
Displayed tab width | Specifies how wide tabs are displayed in units of spaces. | 4
Print margin column | Specifies the column after which the print margin is displayed. To display the print margin, enable the option Show print margin, the preference Appearance color options specifies the color of the print margin. | 80
Synchronize outline selection on cursor move | If enabled, the Outline view always selects the Java element enclosing the cursor in the Java editor. | Off
Show overview ruler | If enabled, the overview ruler on the right border of the Java editor is displayed and shows problems of the whole visible document. | On
Show line numbers | If enabled, the vertical ruler on the left border of the Java editor displays line numbers of the visible document. The color of line numbers is specified with Appearance color options. | Off
Highlight matching brackets | If enabled, whenever the cursor is next to a parenthesis, bracket or curly braces, its opening or closing counter part is highlighted. The color of the bracket highlight is specified with Appearance color options. | On
Highlight current line | If enabled, the background of the current line of the cursor is highlighted. The color of the current line background is specified with Appearance color options. | On
Show print margin | If enabled, the print margin is displayed. The preferences Print margin column and Appearance color options determine the position and color of the print margin. | Off
Appearance color options | The colors of various Java editor appearance features are specified here. Line number foreground The color of line numbers. Matching brackets highlight The color of brackets highlight. Current line highlight The color of current line highlight. Print margin The color of the print margin. Find scope The color of find scope. Linked position The color of linked positions used in code assist. Link The color of a link. | default colors

## Syntax

Syntax specifies how Java source code is rendered.

Syntax
Option | Description | Default
--- | --- | ---
Background color | System default: The default background color given by the operating system. Custom: A user defined background color. | System default
Foreground | The following Java source fragments can be rendered with different color and style: Multi-line comment Comments of the form '/* ... */' Single-line comment Comments starting with '//' Keywords All Java keywords. Strings Java strings and characters, surrounded by single and double quotes Others Default Java source code Task tags Task tags in comments Javadoc keywords Keywords used in Javadoc, starting with '@' Javadoc HTML tags HTML tags used in Javadoc s Javadoc links {@link reference} tag Javadoc others Default Javadoc text | default colors and styles
Preview | Displays the preview of a Java source code respecting the current colors and styles. | n/a

## Code assist

Code Assist specifies the behaviour and appearance of code assist.

Code Assist
Option | Description | Default
--- | --- | ---
Completion inserts/Completion overwrites | If Completion inserts is on, the completion text is inserted at the caret position, so it never overwrites any existing text. If Completion overwrites is on, the completion text replaces the characters following the caret position until the end of the word. | Completion inserts
Insert single proposals automatically | If enabled, code assist will choose and insert automatically single proposals. | On
Show only proposals visible in the invocation context | If enabled, the Java element proposals are limited by the rules of visibility. For example, private field proposals of other classes would not be displayed. | On
Present proposals in alphabetical order | If enabled, the proposals are sorted in alphabetical order. | Off
Automatically add import instead of qualified name | If enabled, type proposals which are in other packages will invoke the addition of the corresponding import declaration. Otherwise, the type will be inserted fully qualified. | On
Fill argument names on method completion | If enabled, choosing a method proposal will additionally insert the method's argument names as specified in its declaration. | Off
Enable auto activation | If enabled, code assist can be invoked automatically. The condition for automatic invocation is specified with the preferences Auto activation delay, Auto activation triggers for Java and Auto activation triggers for Javadoc. | On
Auto activation delay | If the time starting when an auto activation trigger character is encountered until a new character is typed exceeds the auto activation delay, code assist is invoked. | 500
Auto activation triggers for Java | If one of the trigger characters is typed inside Java source code (but not inside a Javadoc comment) and no other character is typed before the auto activation delay times out, the code assist is invoked. | '.'
Auto activation triggers for Javadoc | If one of the trigger characters is typed inside a Java doc and no other character is typed before the auto activation delay times out, the code assist is invoked. | '@'
Code assist color options | The colors used for the following code assist UI elements: Completion proposal background The background color of the completion proposal window Completion proposal foreground The foreground color of the completion proposal window Method parameter background The background color of the parameter window Method parameter foreground The foreground color of the parameter window Completion overwrite background The background color of the completion overwrite window Completion overwrite foreground The foreground color of the completion overwrite window | default colors

Java Editor

Using the Java editor

Java editor Code Formatter preferences Outline view for Java Java Content Assist Quick Fix