Using the editor

JBuilder includes a full-featured, customizable editor that you can use to write your Java code. With Two-Way-ToolsTM, changes you make to the code in the editor are simultaneously reflected in the design view. The editor supports the use of tags, such as @todo tags.

Other productivity-enhancing features in the editor include:

Editor features

Editor features Description
Text Search Finds and replaces text, searches across multiple files, and searches incrementally. Allows you to restart the search from the top of the file if the first search fails.
Syntax highlighting Highlights specified syntax elements in .java, .c, .cpp, .html, .jsp, .xml, .xsl, .sql, and .idl files.
Code templates Inserts code from an expanded list of user-defined templates.
Code style Sets curly brace placement, event handling, and visibility of instance variables.
CodeInsight Displays a pop-up window in the editor that provides help with completing code. Displays tool tip expressions for showing values when debugging. Available in .java and .jsp files.

To access the editor, select the Source tab at the bottom of the content pane on an open, text-based file.

Editor

For more information, see the "Editor" topic in "The JBuilder Environment" chapter of Building Applications with JBuilder.

You can customize your editing environment in a number of ways. Two menus apply: Tools | IDE Options and Tools | Editor Options.

In Tools | IDE Options, under the Browser tab, you can change the look and feel, the keymapping scheme, and the file tab orientation in the content pane. Under the File Types tab, you can add file types and associated extensions. Under the Run/Debug tab, you can set runtime update intervals and debugger update intervals.

The tabs under Tools | Editor Options let you set the following:

For more information, click the Help button on the Editor Options or IDE Options dialog pages (Tools | Editor Options, Tools | IDE Options). For more information on keymaps, choose Help | Keyboard Mappings.

Completing code with CodeInsight

JBuilder's CodeInsight displays a context-sensitive pop-up window within the editor to help you complete your code.

CodeInsight

CodeInsight displays:

You can configure CodeInsight so that it provides the type of information you want while coding.

  1. Select Tools | Editor Options to open the Editor Options dialog box.
  2. Select the CodeInsight tab and change the appropriate options.
  3. Select the Display Options button to customize displayed code in the pop-up windows.

Configure CodeInsight keys by selecting the Keystrokes button on the CodeInsight page. A listing of the default keyboard shortcuts is in Help | Keyboard Mappings.

For more information, see the "CodeInsight" topic in "The JBuilder environment" chapter of Building Applications with JBuilder.

Using code templates

JBuilder includes such default code templates as class declaration, if, if else, try/catch, and while statements. You can use code templates in the editor to speed up the coding process. Enter the code template name, and the editor automatically displays the template. Press Ctrl + j to expand a displayed template or to access the menu of templates.

In JBuilder Professional and Enterprise, code templates are fully customizable. Edit, add, and delete code templates on the Templates page of the Editor Options dialog box (Tools | Editor Options).

Code Templates

For more information, see "Using code templates" in "The JBuilder environment" chapter of Building Applications with JBuilder.