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.
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:
- Editor: smart keys, tab size and block indentation, caret display, the number of backups to keep, search options, and save options. You can also change or customize your editor emulation from here.
- Display: change margins and font.
- Color: choose how to highlight your code and color your text and screen elements in order to indicate what something is doing or what's happening to it.
- CodeInsight: set auto popup option and its delay timing. Set which parts of CodeInsight to use. Advanced Options let you set parameters. You can also set display options and the keystrokes used to invoke CodeInsight. See the "Completing code with CodeInsight" section for more on this topic.
- Templates: select code templates. In JBuilder Professional and Enterprise, you can add, edit, and delete code templates.
- Java Structure: adjust the parse delay and the structure order.
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 displays:
- A list of accessible data members and methods for the current context (MemberInsight).
- A list of parameters expected for the method being coded (ParameterInsight).
- A list of classes accessible through the current class path (ClassInsight).
- Errors in the structure pane (ErrorInsight).
- Tool tip expression evaluation that displays variable values when debugging. Available in JBuilder Professional and Enterprise.
You can configure CodeInsight so that it provides the type of information you want while coding.
- Select Tools | Editor Options to open the Editor Options dialog box.
- Select the CodeInsight tab and change the appropriate options.
- 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).
For more information, see "Using code templates" in "The JBuilder environment" chapter of Building Applications with JBuilder.