tell me more icon Using Java Source Editor Features

The insert or replace mode for the editor is controlled by the Insert key on the keyboard. The default is insert mode. Press Insert to toggle between insert and replace mode.

Java Code Insight

To activate Code Insight, start typing. For example, if you start typing System. to begin the Java statement System.out.println("Hello world"); the source editor will look like this:

Code insight in source editor

With Java Code Insight, you can filter out information not likely to be as useful to you (such as top-level packages, imported classes, default object methods, deprecated items) and emphasize the information that you'll want to focus on (local variables, locally declared members, overloaded methods). You can configure member insight, the Java-specific implementation of Code Insight's completion insight, and you can choose to display deprecated members or not in Code Insight's parameter insight window. Member insight provides you with a list of which instance and static members (fields, methods, inner classes) are accessible from a given statement context.

To trigger Code Insight instead of waiting for it to display, press Ctrl+Space. To customize Java Code Insight, choose Tools then choose Preferences to open the Preferences dialog. Then expand Code Editor, expand Java, and select Code Insight to view the options.

Import Assistance

You can automatically add import statements while working in the source editor. As you are typing in the source editor, if you reference a class that has not yet been imported, a ragged line will appear below it. If import assistance is enabled, a popup will appear with the name of the statement to be added.

By default, JDeveloper automatically adds the import statements for you. To change this behavior, choose Tools then choose Preferences then choose Code Editor then choose Java then choose Imports to open the Preferences dialog, Imports page. Then deselect the Automatically Add Unambiguous Imports option.

If Automatically Add Unambiguous Imports is not enabled, you can manually add each missing statement by placing the cursor on a ragged line, and pressing Alt+Enter.

Import assistance in source editor

If more than one class is available for an import, the popup will display ellipsis dots (...) after the name of the statement.

Import asistance in source editor

When you press Alt+Enter, another popup will display, showing the available classes for importing. Use the mouse or keyboard to select a class and press Enter.

Import statement options

Code Assist

To activate Code Assist, click the code assist icon Code Assist icon in the source editor:

Code assistance in source editor

Code Assist examines your code in the editor and provides assistance to fix common problems. A code assist icon Code Assist icon appears in the editor margin when JDeveloper has a suggestion for a code change. To invoke Code Assist manually, press Ctrl+Alt+Enter. To select an action listed in Code Assist, press Alt+ the underlined key.

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,