Saturday Jun 27, 2009
Calling all users/developers of XML Multiview, please vote to the issue and share your experiences and design inputs into the issue report.
To update the issue please click here.
For those who are new, XML Multiview is a nice feature in NetBeans that helps to create a fantastic and easy to use XML Editor based on any DTD or XSD. Many of the existing NetBeans modules such as Java EE use this API extensively. (for example, web.xml editor). Also this API is used in many NetBeans platform based application as well.
Thursday Jan 15, 2009
This week's NetBeans news-letter posted a new cool screen-cast on Hibernate support in NetBeans 6.5 IDE. The screen-cast available on www.netbeans.tv shows many features as part of the Hibernate support in the IDE, including, creation of Hibernate configuration file, running Hibernate reverse engineering to generate POJOs and finally using HQL Editor to create and execute HQL queries right from the IDE.
Check out the screencast and the following tutorials posted on the Web Application Learning trail page and send us your feedback/comments.
Monday Jan 12, 2009
NetBeans module development (many times) involves running two IDE instances at the same time : development IDE, where actual module code is written and the target IDE where the code is executed and verified. While fixing a recent issue, I had to make the target IDE run on J2SE 6.0 and was able to debug the code, while the development IDE still running on J2SE 5.0.
This is tricky since, the target IDE by default runs with the same J2SE version as of the development IDE, there's little manual work required.
Here's what worked for me :
- Enable debugging for development IDE : Open main/nbbuild/netbeans/etc/netbeans.conf and append the following line to "netbeans_default_options".
-J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4444
- Attach the debugger : Start the target IDE outside the development IDE, you can use the platform specific launchers inside main/nbbuild/netbeans/bin folder. (For example, on Solaris use netbeans script.) Then load the sources (open relevant module project) in the development IDE and select 'Debug/Attach debugger" from main menu. Enter the port as 4444 (as set previously, this port number should be freely available on the system and should be accessible). Then we are ready to debug the code by putting breakpoints where required and examining the variables and call stack... For more info. on debugging using NetBeans IDE, look at this FAQ.
Coool ?
Thursday Oct 23, 2008
As you might have noticed, NetBeans is celebrating its 10th birthday. And to add to this event, NetBeans 6.5 IDE RC1 is out. (Download it from here). Its no surprise that it bears the event stamp on the splash image.

Wednesday Oct 08, 2008
During debugging, if NetBeans sees several method calls on a single line, it allows you to choose for stepping into one of them. So cool !
Update : This feature is available in NetBeans 6.5 beta onwards.
Monday Dec 17, 2007
I wanted to create a toolbar button similar to debug or profiler button in NetBeans 6.0 IDE as in the image below.

This image shows the 'debug project' and 'profile project' with a small downward arrow that shows the user clearly that this is a button with a dropdown menu attached to it. To create a toolbar button with drop down menu, I followed the NetBeans DeveloperFAQ wiki which explains how to add dropdown to a toolbar button.
But the wiki help did not resulted in the purpose visually, although it helped me to put up a JToggle Button with attached drop down menu shown in the following images:

There's clearly no visual hint, unless clicked on the toolbar button. So I decided to look further into the source code. I failed to look up the 'debug project' toolbar button code (I couldn't find it in Java or Java/j2se modules), however, 'profile project' was easily visible. The class which creates this 'profile project' toolbar button is org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.java. The getToolbarPresenter() has an interesting code to create that small arrow..
JButton button = DropDownButtonFactory.createDropDownButton(
new ImageIcon(
new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB)),
popup);
Actions.connect(button, defaultAction);
toolbarPresenter = button;
So instead of creating a JToggleButton, it creates a normal button with a predefined image as the button icon. I think, the Actions.connect() will combine the button with the current action (visually I guess). Its really nice and handy trick to get the visual hint. Following images show the result.

Thursday Oct 25, 2007
One important and latest update : The plugin update center URL is updated to the latest one on www.openInstaller.org site. The updated plugin is also available on the NetBeans 6.5/7.0 development update center but I am not able to get the URL of of that anywhere. So you can use the update center available from www.openInstaller.org site which is here.
Thanks to one of my blog readers whom I met at Sun tech days Hyderabad yesterday who pointed this error. I happen to lost his name from my memory.... 
Since the announcement, there have been lot of requests for improvements for Netbeans Application Installer Generator plugin. Netbeans Community members as well as NetCAT members recognized this plugin. Many members want this plugin to support other Netbeans project types such as Java applications and web applications. I am currently working on to support creating installers for Java applications built from Netbeans. The user experience will be similar to the Netbeans module suite projects that exists today.
Today I updated the NBM with the issues reported by the community members. The following issues were addressed in this update:
- On windows, the created installer, when launched from inside the Netbeans, uses the correct and existent JDK available on the system.
- On Windows 2003, the plugin was not installing the product.
Thanks to all community members who reported the issues. Mainly, Wadi Jalil Maluf, Juergen and Peter Blemel.
The following are the upcoming tasks that I am working on now:
- Support installer creation for Mac OS X.
- Support for installer creation of Java application projects.
- Uploading the sources to http://contrib.netbeans.org.
The update center URL is still the same : here. Try out this update and let me know what do you think..
One more update: The plugin is going to be part of the development Auto Update Center modules and will be available for download from the same update center inside NB 6.0. Here is the issue related to this request.
Saturday Oct 20, 2007
Are you not satisfied with the zip bundle thats generated out of your module suite from Netbeans? Are you looking for an easy way of generating installers for suite projects right inside the Netbeans IDE?
Well, here it is..a plugin based on openInstaller installer framework that does just this. openInstaller is an extendable, cross-platform, multi-home install and customizable installer framework. All you have to do after installing the plugin is :
- Configure your module suite to be 'standalone'. This is required to generate an installer. The plugin will assist you in this if you have not configured your module suite project yet.
- Choose the Generate suite installer button on the toolbar (with CD icon
). This will bring up the wizard. - Enter the basic details about your application (like, name, version, system requirements and license).
- When you click Finish on the wizard, the plug-in will generate an installer and keeps it under 'dist' folder. There are three zip files in that folder : one module suite zip (generated by Netbeans, as before), <YOUR_APP_NAME>-binary.zip is the generated installer (you can rename this to any name you want and <YOUR_APP_NAME>-source.zip which contains the source files for the installer. The latter can be used in upcoming openInstaller IDE to customize the generated installer.
- Distribute <YOUR_APP_NAME>-binary.zip bundle and unzip on the target machine and execute the launcher script specific to your platform (There's one for all *NIX and one for windows).
Download the plugin from this update center. (you need to manually configure this update center in your Netbeans IDE. If you do not know how to do this, go here. Look into the first part and use this update center link.
More information (in the form of FAQ) about the plugin is here.
You really have to see this flash demo which shows how easy is to generate an installer for your module suite application.
Disclaimer: The module described here are purely experimental (alpha version), so no guaranties. Use at your own risk.
Below are the screenshots of the plug-in actions..
The screenshots show the process of generating installers for the FeedReader suite sample that comes with Netbeans IDE



Acknowledgments :
A lot of people helped me and involved directly and indirectly on this work,. I would like to take this opportunity to thank them :
Christian my director, who supported this work, Matthew Williamson who encouraged me on this, my earlier manager Gowri Sivaprasad, my colleagues who worked with me on this : Mahesh and Nandagopal, the core framework team (Jayanth, Sandeep, Rajkumar, Karthickraj, Gustav) the core framework architect James Falkner, the lead Manpreet Singh, Radhika who carefully reviewed design documents and last but not the least, Geertjan, who was involved in this since its inception, the idea, the design, the help guide.. (ahh.. he made it every sentence sound right in that) and lot of help and guidance..
Thanks to you all.
Monday Oct 01, 2007
Geertjan wrote a nice article (as part of the Filthy Rich Clients series) about how to use the glasspane to mask the entire application window and show a progress bar. This effect can be seen in most of the flash based websites such as google analytics and flickr. This screenshot speaks for itself.
Nice article Geertjan.. Thanks for putting this up!
Saturday Aug 04, 2007
[Read More]
Thursday Jun 28, 2007
XML Multiview API extends the base Multiview API for XML files. It helps in creating visual editors for any kind of XML files which has a defined DTD or schema. We this being used extensively like in web.xml editor in J2EE web applications.
Please vote here.
Wednesday Jun 27, 2007
With the help of Geertjan's blog series (part1, part2, part3, part4 and part5) about how to make use of Wizard API to define our own wizards, I created a wizard to create a new XML file in my own custom project. Thank you Geertjan for posting this wizard series. It helped a lot.
I used 'New Wizard' wizard to create a wizard with 4 panels for creating a new file. The wizard for 'New Wizard' generated bunch of files and updated the module layer file by registering itself as the "instantiatingIterator". I just copied this part in the required place under 'Template' folder defined for the new filetype, for which I want this wizard to be shown. More details on this and how to create 'New Wizard' using the wizard are in part4 of Geertjan's series as mentioned above.
Ok, so far, so good. now onto the next things. I need to :
- Collect all the user inputs from 4 wizard panels.
- Provide just-in-time validation for mandatory fields and disable 'Next' button if required during validation errors.
- Create a new XML file with user data filled in.
Ok, for the first, I am using WizardDescriptor to remember the user inputs across the panels. Here wizard descriptor is the data store and each 'WizardPanel' (not the visual panel) have methods to store/retrieve data from this data store. So when the user goes to next panel and comes back to the current panel, the entered value is retained. See the javadoc for WizardDescriptor.Panel for more details on how to use these methods.
On the second point I was looking for some examples on how to implement the just-in-time validation. I saw this happening in existing several places like, New File Wizard, New Project Wizard etc.. Here is the panel from 'New Project Wizard' showing just-in-time validation with an error icon and a message below the fields, but just above the navigation buttons.

So cool.. ok where should I look for the help? ask in mailing lists or search? Well.. best and quick way : look into the sources!! Yes, look into the corresponding sources..
"apisupport/project module" (org.netbeans.modules.apisupport.project.ui.wizard) is the one. Geertjan recently wrote about how to re-use the existing wizards and customize them. Another great series from Geertjan! (part1, part2 and part3). Nice, thank you Geertjan again. So going back to org.netbeans.modules.apisupport.project.ui.wizard, I could see how the whole new module wizards are created. There are two base classes : BasicWizardPanel.java and BasicVisualPanel.java. [both links point to repository source browser] The BasicVisualPanel class has the helper methods like setting the error message, setting warning message, marking the wizard state as invalid so that the 'Next' button is disabled and finally clearing any warning/error messages and making the wizard state valid. This is convenient as any wizard panel which extends BasicVisualPanel class, will have all these methods ready and available for use. There is a notification in the form of Property Change event to tell the wizard panel about validation results and enable/disable 'Next' button.
The Basic wizard panel listens to the property change events and updates the wizard state when required. This having two different classes for each wizard panel (wizard panel and a visual panel) is considered to be performance wise good. See details about why this is so here.
About the third, I need to construct a DOM tree or a JAXB stub with data read from wizard descriptor and filled into it and marshal the stub to a physical file.
Netbeans wizards are indeed mightier...
Friday Jun 22, 2007
Suddenly there is a lot talk about wizards.. Geertjan blogged about them recently and he writes about an interesting ways to re-use the built-in wizards from 'apisupport/project' module. Really cool.
And there is one more.
I am too into creating wizards ... ! [why shouldn't I, when everybody is talking about?
]
Will blog about them very soon.
Tuesday May 01, 2007
A rather appropriate timing

copied from here.
Thursday Apr 26, 2007
Recently I helped Geertjan on creating a new XML multiview for x-work (here and here) related XML files. I thought why can't I convert the discussion I had with him along with known questions into a growing FAQ?
Here is it.
- What is XML multiview API?
Extension of Multiview API (which allows to create different visualizations for single files.) The XML multiview API extends the Multiview API to support for XML files. It also includes two way synchronization between the visualizations and the XML file.
- Where can I get this API?
The API is part of the Netbeans 5.x (upwords) distribution. However, both Multiview API and XML multiview APIs are not yet stable APIs. Still the XML multiview API is used in number of places like web.xml file editing in Java EE application development.
- Are there any tutorials and samples for this?
Yes, original Geertjan's blog entry, my tutorial series, part1, part2, and part3
. The netbeans xml multiview source code includes a Book Example as part of the unit tests and its used in Geertjan's tutorial and as well as in my tutorial series.
- What all I can do with XML multiview API?
Develop different kinds of visual editors for any XML file which has a well defined schema or a DTD. You can have a tree type multiview editor similar to the Windows Explorer or the WSDL editor in Netbeans Enterprise Pack 5.5. Also you can have a toolbar multiview, which allows to create multiple separate or shared views for a single file. Each view can be activated by clicking the corresponding button on the toolbar. This is the type of visual editor used in web.xml file editing. You can provide separate visual editors for each sections of XML file and you can have different visual editors for the same XML file or a section of it.
- So how do I get started?
Read the tutorials. XML multiview requires javabeans to store/retrieve data to/from XML file. You can use schema2beans as described in the tutorial or from Toni's tutorial on schema2beans generation starting from here. You can also use any other API such as JAXB to generate beans. However, you need to update the two way synchronization accordingly. For schema2beans, it just works. The XML multiview API does not mandate or depend on any of the bean generation technologies.
- Ok, I have the beans, where is the starting point?
The easiest way to start is by defining the custom file type support for your XML file in your module. After you create new file type support, you need to modify the generated data object to confirm to the XML multiview API. You need to extend the data object from XmlMultiViewDataObject and implement all the required methods of this class.
- What all the important methods that I need to implement from XmlMultiviewDataObject, in my existing generated data object?
The following are the methods with their functionality outlined:
getMultiViewDesc() - Create multiple multiviews and return an array of them.
showElement() - Return the root element bean
Apart from this, you need to create new multiview classes and implement ModelSychronizer and a callback method to signal the synchronization mechanism that the data has changed. - Coming soon.
- Coming soon.
Good luck :)