Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
TDMWeb Kylix Developer's Guide
 JBuilder 2 New Features
See Also: JBuilder Papers

JBuilder 2 has now been released almost a month ago, so it is time to take a look at some of the new features. And there are a lot of new features! Let's start with a look at Code Insight.

Code Insight
So at first sight it seems nothing much changed at the Java source code editor, but looks can deceive. There is a lot of new fun included in the editor, that make our lives a lot easier. One of this features is Code Insight.

Code Insight displays context-sensitive popup windows within the editor. Code Insight provides the following:

Package browser
Let's say you want to add a declaration to create a new instance of a class, but you don't want to typ in the class name and the neccessary import statement at the top of your class declaration. JBuilder can make this process a little easier.

Press Ctrl+Alt+Space to activate the Package Browser. See the figure below for this dialog.

Package browser

You will see a list of package in the class path. You can go to the class you want to declare and press the OK button. JBuilder will insert the name of the class at the cursor and will also insert the necessary import statement. You can see in the figure that JBuilder inserted the import java.util.* statement at the top of our code. And the statement Calendar is inserted in the constructor.

Result from package browser

Code completion
Everybody who has worked with Delphi 3 or C++ Builder 3 knows this feature, and I always look with envy at the guys who could use this feature. But now we can also impress everybody else.

This means that when you type the name of a class instance (such as Button1) followed by a dot, you get a list of all properties and methods that are part of this instance. This is very handy, as you no longer need to remember the name of that method or property, and only have to select the right one from the alphabetically sorted list:

Code completion

You can also get this list of properties and methods on demand by typing Control+Space in the editor. When you press this key combination and your cursor isn't right behind the dot, the popup window will display all methods and properties relevant to the class you working on:

Code completion

Parameter lists
You don't have to remember anymore what parameters a method or constructor takes, JBuilder shows you right on the screen. Right after you've typed the name of the routine and the opening parenthesis, JBuilder 2 pops up a list of parameters, including their types. The current parameter is presented in bold, so you always know where you are in the list of parameters:

Parameter lists

To get the list of parameters on demand you only have to type Control+Shift+Space in the editor.

Tooltip expression
When you are debugging a program, you can place the mouse cursor over any variable in the Editor to display its value. The value is displayed in a small popup window that looks like a tool tip:

Tooltip expression

Syntax highlight declaration errors
When you typ a declaration of a class name that isn't in the import statement(s) of your class, JBuilder will use the Illegal element color (on the Colors page) to highlight this class name. So you will know to add an import statement that will include the class. In the following screenshot you see JBuilder noticed the fact that I hadn't import the package with the class.

Syntax highlight declaration error

As you can see for yourself these are some very time-saving features and will make your programming task a lot easier.

This webpage © 1997-2010 by Bob Swart (aka Dr.Bob - All Rights Reserved.