What’s New in JBuilder 2005?

JBuilder changes so fast that many developers simply don’t keep up. After all, how much improvement can happen over 9 or even 18 months? A lot! This session shows you what you’ve been missing if you are still using an old version of JBuilder. It covers the new features included in both JBuilderX and JBuilder 2005, running the gamut from IDE improvements for coding to the new wizards to simplify complex tasks like web services, EJB development, and Java Server Faces. Throughout this tutorial, I will point out new features and in which version they first appeared.

However, this tutorial is more that just a laundry list of the new features of JBuilder. It is really an exploration on how to use this state-of-the-art IDE to become more productive, no matter what kind of Java development you do. Through this tutorial, I’ll show you lots of tricks and techniques (some of which have been around for many versions) that many long-time developers still don’t know about.

IDE Enhancements

Every version of JBuilder features new, sometimes subtle changes to the IDE.

Personalities

Since JBuilderX, JBuilder has offered personalities in the IDE. This allows users the turn off functionality that they don’t need on a daily basis. For example, if you never do CORBA development, you can have JBuilder hide the CORBA features. Personalities are accessible from the Project | Properties dialog or from Tools | Preferences.

 

Personalities allow you to customize the environment to your liking

If you choose this setting from the project properties, it only hides the features for this project. If you set it through the Tools menu, it affects the entire IDE.

Note that de-selecting one of these items does not uninstall this feature — it simply hides it. Thus, this does not make JBuilder’s footprint smaller. It only hides the features in which you have no interest.

Settings Import

JBuilder 2005 prompts for and imports the settings you have set for a previous version of JBuilder. This removes one of the common busy tasks

Support for Java 5

JBuilder 2005 now supports Java 5 (formerly known as Tiger) in the editor and compiler. You can install JDK 1.5 into the JDK’s in JBuilder and build projects using the new language features such as enumerations and generics. The editor correctly parses the new syntax and allows you to work with Java 5 effortlessly.

 

JBuilder 2005 supports Java 5 syntax and concepts.

Editor Enhancements

Over time, the JBuilder editor has grown some amazing features. In JBuilderX and 2005, that trend has continued. This section highlights some of those enhancements.

Code Folding

JBuilder now allows you to fold code at the method, class, and JavaDoc level. This allows you to compress the file to see just the methods, which is handy when navigating large source files. Of course, you can click on the icon in the gutter to flow code. You can also use the Edit | Code Folding menu.

 

The Edit menu allows you to handle code folding.

JBuilder also allows you to mouse over the folded code to see what is hidden in a tooltip.

Project-wide To-do’s and Bookmarks

JBuilder now allows you to consolidate your ToDo tags into a single pane. For many versions, JBuilder has supported the special @ToDo JavaDoc tags, both in the code it generates (to remind you to implement methods, for example) and for your own notes to yourself. JBuilder now allows you to see a view of all the ToDo’s, project wide. If you go to Search | View ToDo’s, a new pane opens at the bottom, showing all the ToDo’s in the project.

 

The Search menu allows you to view project-wide ToDo’s.

Similarly, you can now set project-wide editor bookmarks and get a comprehensive listing of them, via the Search | Bookmarks view. Also, you can invoke Search | Add Bookmark to create new ones outside the editor pane. Here is the listing of the current bookmarks.

 

The Bookmarks dialog allows you to see all current editor bookmarks.

Tree-based Configuration Dialogs

The Tools | Preferences and Editor Preferences dialogs were getting quite busy with the tabbed interface. Starting in JBuilderX, the configuration dialogs are now tree-based.

 

The Preferences dialogs use left-hand trees for categorization.

You will also notice that the Tools | Preferences dialog and the Project Properties dialog both appear in the same view. You can still access the project properties independently if you like, but this is handy for those time when you don’t remember whether a setting is project wide or IDE-wide. A single configuration dialog handles both.

New Editor Wizards

The Wizards top-level menu has been demoted to a sub-menu under Edit in JBuilder 2005. The same options are still available, including Override Methods and Implement Interface.

 

The Edit | Wizards dialog features several important helpers.

Two of the most under-utilized features of JBuilder are the wizards for Override Methods and Implement Interface. A new entry here is the Delegate to Member wizard. This allows you to create a delegate method for one of the member variables in your class. Here is an example. Consider this listing class, which includes a java.util.List member variable named myList.

Simple Lister Class


public class Lister {
    private List myList = new ArrayList();
    public Lister() {
        myList.add("Neal");
        myList.add("BorCon 2004");
        myList.add("JBuilder 2005");
    }
    
    public String toString() {
        StringBuffer buf = new StringBuffer(100);
        for (Iterator it = myList.iterator(); it.hasNext(); )
            buf.append(it.next()).append('\n');
        return buf.toString();
    }
    
    public static void main(String[] args) {
        Lister lister = new Lister();
        System.out.println(lister);
    }
}

The Edit | Wizards | Delegate to Member wizard allows me to choose which method I want to delegate to the Lister class from the embedded object.

 

The Delegate to Member Wizard

In this case, I choose the add() method from the Collection interface (which is one of the base interfaces behind List). The wizard adds the following method to my class.

Delegate Method Added by Wizard


    /**
     * Delegate method boolean add() to myList : List
     *
     * @param o Object
     * @return boolean
     */
    public boolean add(Object o) {
        return myList.add(o);
    }

This wizard is a powerful code generation tool that handles a common necessity. Just like the other code generation wizards, this one can save an enormous amount of time searching through class definitions and typing code by hand.

Productivity

The productivity category is a catch-all for general enhancements that don’t really fit into other categories.

Regular Expressions in Search and Replace

The Find dialog in JBuilder has featured regular expressions for several versions. What’s new in this version if the ability to use regular expressions in searches across files. This is a really powerful feature because it allows you to investigate files in a large project in a discriminating way.

Improved Twilight Theme!

OK, this doesn’t mean much to most people, but I’m a big fan of the Twilight editor theme, and it was broken in JBuilder 9 (the text remained black on a black background). The Twilight theme has been fixed and improved in the last 2 versions of JBuilder. Actually, from talking to JBuilder developers and users, it seems that the use of the Twilight theme is a bit of a cult — it seems to pop up for everyone in a particular company. In other words, once developers start using it, they "infect" other developers around them. You should try it. The dark background with light text is actually easier on your eyes after a full day of staring at the computer screen. White background is fine for paper (which is reflected light), but fatiguing for generated light (like a monitor). Twilight makes your eyes less tired at the end of the day.

Hotkeys and Keymaps

The keymapping functionality has improved with new features for importing, exporting, saving, renaming, removing, copying, and creating new keymaps. When you open the Preferences dialog box (Tools|Preferences) and choose Keymaps, you can view the New, Copy, Rename, Remove, Import, and Save As buttons on the Keymaps page. This allows you to customize the keymappings and save them for others.

 

The Keymaps allow you to customize and save keymappings.

File Status

When a file has been modified, the icon in the Project pane changes to show that a change occurred. Also, the status "propagates" up the package viewer to the top, so that you can tell at a glance if any files in a package have changed.

 

The project pane shows changed files.

Support for Subversion

Many developers use CVS as their version control package because it is freely available and has a long established reputation. However, CVS has serious shortcomings because of the way it was originally implemented. A few years ago, several CVS experts decided to "fix" CVS, and realized that the only way to fix it was to replace it. The end result is Subversion, which supports the features of CVS but none of the shortcomings. Subversion is an open source version control package available at www.tigris.org. It is widely regarded as the successor to CVS in the open source SCCM space. Of course, Subversion doesn’t offer the breadth and depth of commercial products (like StarTeam), but it is the best of the open source packages.

JBuilder 2005 now has first-class support for Subversion. First, set Subversion as the project VCS. When you start to add a project to the repository, use the Team | Place project in Subversion menu item, which presents this dialog:

 

Subversion repository chooser dialog.

Notice that JBuilder 2005 supports both local and remote repositories. You will also note that JBuilder is adding the project’s last path portion as "trunk". This is a Subversion best practice, related to how Subversion handles project URL’s.

Next, you choose which files to add to the repository.

 

The Subversion dialog allows you to choose which files to add to the repository.

Once the project is in Subversion, the Project pane changes to show the status for each file in the repository. As changes are made, the project manager notifies you icons. At any time, you can look at the changes to a particular file and compare them to the version in the repository.

 

JBuilder allows you to make comparisons to the repository.

Favorite new Hotkeys
  • Window | Switch Project (Alt + <n>) Switches between open projects with a hotkey
  • Toggle visible whitespace (Ctrl-Shift-X) Toggle the display of visible whitespace (a good way to tell if you have tabs or spaces in your file)
  • Widening Code Selection (Ctrl-W) Gradually widens the selection of highlighted code

No comments yet

Leave a Reply

You must be logged in to post a comment.