Java editor

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

Appearance

Appearance specifies the Java editor's appearance.

Appearance

Option

Description

Default

Text font

Click the Change... button to change the font for the Java editor.

By default, the workbench text font is used. The workbench text font is specified on the Workbench > Fonts preference page.

<Using Workbench Text Font>

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

Insert space for tabs

If enabled, hitting the tab key results in inserting spaces instead of a tab. The amount of spaces inserted is determined by the Code Formatter preference Number of spaces representing a tab.

See Code Formatter preference page

Off

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.
Problems highlight
The color of problems highlight.
Print margin
The color of print margin.
Find scope
The color of find scope.
Linked position
The color of linked positions used in code assist.

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.
Javadoc keywords
Keywords used in Javadoc, starting with '@'.
Javadoc HTML tags
HTML tags used in Javadoc s.
Javadoc links
{@link reference} tags.
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

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.

'@'

Colors for completion proposals

The colors used for the code assist window.

default colors

Colors for method parameters

The colors used when showing method parameters as tooltip.

default colors

Problem indication

Problem Indication specifies when and how compilation problems are displayed.

Problem Indication

Option

Description

Default

Show problems before compiling

If enabled, compilation problems are updated as the user types. Otherwise, compilation problems aren't updated until the Java file is compiled.

On

Highlight problems

If enabled, compilation problems are highlighted in the Java editor by underlining each problem with a squiggly line.

The color of the problem highlight (squiggly line) is specified with Appearance color options.

On

Indicate problems solvable with Quick Fix in vertical ruler

Displays a light bulb on the vertical ruler on the left border of the Java editor for every problem solvable with Quick Fix.

On

Related concepts

Java Editor

Related tasks

Using the Java editor

Related reference

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