Joshua van Aalst’s blog

April 14th, 2008

Introducing Netbeans 6.1 - Taking Netbeans from good to great!

Posted by Joshua van Aalst in Netbeans, Reviews

Having been a long time Netbeans evangelist and community tester of the Visual Web pack, I thought what better way to help support the Netbeans team than with an in-depth blog on the exciting new Netbeans 6.1.

I have been using Netbeans since version 3 for various software projects including my community website www.joshandfriends.com.au and the development of the Internet Bank at www.stgeorge.com.au . I have also had significant exposure to the Eclipse IDE whilst working at Macquarie Bank.

This blog is a thorough review of the Netbeans 6.1 IDE and its new features. I will also make many comparisons to the Eclipse 3.3 IDE.

The project

I plan to build a campaign management product to display advertisements on my website www.joshandfriends.com.au . For administrators this application will be secured through integration with Vbulletin forum software.

The review computer

A Dell Inspiron 6400 laptop Pentium Core Duo (not Core 2 Duo) 2ghz processor with 2g of ram, a 60g 7200rpm hard drive and an ATI mobility Radeon x1400 128mb graphics card.

Initial thoughts – IDE performance

The improved startup time of Netbeans 6.1 IDE was obvious. The initial IDE start up, with 3 projects of 2 ,700 files took 50 seconds and subsequent start ups took only 5 seconds! In fact the whole IDE felt lightweight and fast. This is a dramatic different to previous versions of the IDE which were sluggish when performing certain tasks.

Another noticeable performance benefit of Netbeans over Eclipse is the complete lack of IDE blocking. Classpath changes are quietly scanned in the background and do not cause performance degradation and by default projects are compiled when the user chooses to do so, rather than automatically like Eclipse, which locks up the IDE at non-opportune moments.

Project creation

One thing that I have found a little difficult when configuring a new Visual Web Project is that it is not obvious that the “Default Java Package” setting should be a java package in the format com.mydomain.myapplication . I have often created a new project only to quickly delete and re-create due to the lack of description of this field.

In addition, I found that certain combinations of frameworks are incompatible. For example the Visual Web Pack and JavaServer Faces frameworks clash over the faces configuration file. I would advise only allowing a single Web UI technology to be selected.

Another very welcome feature edition of Netbeans 6.1 is the library sharing which is much needed if Netbeans is to compete with Eclipse in multi developer development environments. The feature enables the developer to have jar libraries located in a central folder on the file system. The end result is that multiple users and workspaces can access the same set of jar library definitions. This was a big issue in earlier versions of Netbeans where developers would be forced to re-add all libraries for each workspace. Overall the feature was easy to setup and use. It even asked you to import jars into your common library directory if they weren’t already in there. The only constructive criticism I have is that later when I wished to move the library folder’s location I found no function to enable me to do so and also I noticed that I couldn’t change library names once they were created.

One thing I must add here is that I believe it would be extremely useful to have Netbeans work in Eclipse compatibility mode. Such a feature would enable Netbeans to read and write to Eclipse project files. I am aware of the Netbeans Eclipse Project Importer module but I find it almost never works in large projects due to the way Eclipse references jars. I also find that in the corporate world developers tend to try Netbeans one at a time rather than with an all out team decision to convert IDEs. Such functionality would allow a team member to use the IDE in harmony with other Eclipse developers. Intellij already offers this and it has helped the adoption of that IDE.

Refactoring

Upon creating a new web project I attempted to rename the default package as my requirements had changed. Netbeans displayed an error message: “Error: Cannot rename default package”. This is something I believe needs to be addresses as default packages will often need to be refactored after creation. On the upside, I was able create a new package and move the Netbeans generated JSF files to it.

New hot keys

If you are still making the switch from Netbeans 5.5 to 6 or 6.1 please note that the default hot keys have changed. This caught me a little off guard but all in all the new keys were easy to pick up.

Netbeans 6.0 editor niceties

If you haven’t tried the Netbeans 6 editor then you’re in for a treat! It has all the usual Eclipse niceties including the ability to click on an error message and have the IDE fix the error such as “Implement all unimplemented methods” and also auto generation of object and variable names.

The only feature I found missing, which is useful in Eclipse, is the ability to not only see a drop down list of open files but also to enter a text filter to search for a specific open file.

An added bonus for the XML editor was its new feature to format XML.

Visual Web improvements

Immediately apparent to Visual Web users is how clean and neat the generated JSPs and backing beans have become. The removal of the rarely used binding objects has resulted in this and if you need them you can add them manually back in.

Also new in Netbeans 6.1 is the ability to generate JSF CRUD (create, read, update and delete) pages for JPA entities. This was both useful and cool. Not only were CRUD pages generated but the IDE even generated an array of standard error and success messages.

A nice to have, on the Web development side, would be the ability to auto generate import definitions for classes in jsps.

CVS

Having somewhat missed the Netbeans 6 upgrade. I was very keen to try the enhanced version control functionality that was released with that particular version. Although the functionality was visually a big improvement I found that Netbeans lacks the ability to see an overall repository view, like the CVS view in Eclipse. I would suggest that a new section for versioning be added to the Services window which allows developers to browse repositories.

Clear and concise help

The supplied help available in Netbeans IDE is clear and concise. I referred to it several times whilst writing this blog entry and especially for accessing the new features available in Netbeans 6.1 such as the CRUD generator.

April 6th, 2008

Netbeans 6.1 Review and Netbeans 6.1 vs Eclipse 3.3

Posted by Joshua van Aalst in MBA, Netbeans, Reviews

Hi all,

As a long time Netbeans evangelist and blogger, I have been spending a great deal of time writing a thorough Netbeans 6.1 IDE review. It is also written for those who seek to compare it with the Eclipse 3.3 IDE.

The review is now available here: >> CLICK ME <<

p.s. I haven’t heard back from MIT yet. It seems that they will hold true to their word of announcing on the 7th of April. I am so nervous and excited it is crazy. I haven’t slept for 2 weeks!

August 25th, 2007

Quick catch up!

Posted by Joshua van Aalst in Interesting Stuff, Josh and Friends, Netbeans

Alright everyone…..

Here is a quick catch up of what’s been happening with me.

Gayscene to be merged into Josh and Friends

Thats right very shortly the content of Gayscene will be merged into Josh and Friends. That means I’ll be adding a new Category group. I still need a name for this group so if you have a good idea for one please email me at josh@joshandfriends.com.au . Basically the category will have a couple of options to describe at what demographic the DJ, Event, News e.t.c. aims at. The options at the moment are Gay scene, Lesbian scene, 18+, Under 18.

Their will be a new forum added for Gay and Lesbian events.

Personal Development

I am working extremely hard at personal development at the moment. Normally when I hear someone say they have been doing personal development I imagine that to be someone trying to find themselves. Believe me when I say i’ve found myself, and i’m only describing what i am doing as such because I can not announce it just yet. It’s all very exciting though!

Facebook

Yes, I have joined the revolution with both my own personal Joshua van Aalst page and also a Josh and Friends group. I must admit so far i’m absolutely loving it. I have managed to contact almost all of the friends i wish i would have kept in contact with but didn’t. It’s great seeing what they are all doing on a day to day basis.

If you haven’t used Facebook it is alot like Myspace except with an exceptional tracking system that provides you with an overview of what all your friends are doing. E.g. “Joshua van Aalst is now friends with Ella Parker”.

New version of Josh and Friends website

I have also been working ‘reasonably’ hard on a new version of the website. Unfortunately I did something rather silly. The site is written in Netbeans 5.5.1 (the current production version). I upgraded to the milestone version of Netbeans 6 which is full of show stopper bugs. I have not been able to migrate back to version 5.5.1. I am left with a choice; persist and wait till mid September when Netbeans 6 goes beta or work off a backup and migrate at a later date. As I am doing the ‘Personal Development’ above I have decided to go with the former. This may mean that an upgrade to the site won’t happen till end of September. What’s in this upgrade i’m speaking of? I’ll blog about it in a separate post.

A Night Of Trance

Tennille has squeezed my arm and we are going to run an A Night Of Trance event on September 21 at ARQ. Their hasn’t been one for 6 months and we are very excited about the return of uplifting Trance to Sydney. It has been a rather depressing time for Trance in Sydney and I hope that everyone will get out in force to support the event and show that we still LOVE our Trance! - Make sure you bring a friend to the event.

Swimming

I’m also back at the pool 3 days a week again. As the months are getting warmer it’s time to trim down and get in shape.

June 29th, 2007

Netbeans 5.5.1 Visual Web Pack ‘webui’ is undefined javascript solution/fix.

Posted by Joshua van Aalst in Java and Web Development, Netbeans

Hi everyone,

I recently upgraded from Netbeans 5.5 to Netbeans 5.5.1 and noticed that some of my Visual Web Pack pages were rendering with the javascript error ‘webui’ is undefined.

If this error occurs most UI components on the page will cease to function.

Basically some new javascript libraries were added to Netbeans 5.5.1 and all components require them but some pages were not generating the required javascript code.

So what is required to fix this?

Ensure the following lines are at the top of the Visual Web Pack page that is causing the ‘webui’ is undefined error:

dojo.hostenv.setModulePrefix("webui.suntheme", "http://www.joshandfriends.com.au/dancemusic//theme/com/sun/webui/jsf/suntheme/javascript");
dojo.require('webui.suntheme.*');

]]>

Obviously change the domain above to your own.

If you would like a simpler way of doing the above that is dynamic and can be reused on any page with the issue then create a converter like so:

package com.jafp.web.jsf.converter;

import com.jafp.common.configuration.SystemConfiguration;

import org.apache.log4j.Logger;

/**
*
* @author Joshua van Aalst
*/
public class DojoJsConverter implements Converter
{

public String getAsString(
FacesContext context,
UIComponent component,
Object object)
throws ConverterException
{
try
{
Logger.getLogger(getClass()).debug(”Start DojoJsConverter”);
ResponseWriter writer = context.getResponseWriter();

writer.startElement(”script”, component);
writer.writeAttribute(”type”, “text/javascript”, “type”);

writer.writeText(”\ndojo.hostenv.setModulePrefix(\”webui.suntheme\”, \”"
+ SystemConfiguration.getSystemConfiguration().getApplicationPath()
+ “/theme/com/sun/webui/jsf/suntheme/javascript\”);\n”, “dojoscript”);
writer.writeText(”dojo.require(’webui.suntheme.*’);\n”, “dojoscript”);

writer.endElement(”script”);

Logger.getLogger(getClass()).debug(”End DojoJsConverter”);
return “”;
}
catch (Exception e)
{
throw new ConverterException(”Unable to generate a link for supplied object”, e);
}
}

public Object getAsObject(
FacesContext context,
UIComponent component,
String displayString)
throws ConverterException
{
return 3;
}

}

Now you can simply do this:

]]>

You can of course simplify this further by adding all .js includes to your converter. Then all you will have is 1 line:

]]>