Reviewing NetBeans Book

24 07 2009

This year, I received an email from Packt Publishing, inviting me to review one of the books based on NetBeans IDE, Java EE 5 Development with NetBeans 6. I was quite excited about this opportunity and after exchanging few mails with their Market Research Executive, accepted the invitation.

After nearly 2 months, I was able to finish reading the book and here’s my review of the book. Read it carefully and I feel you would enjoy reading the book as I did, because of its easy reading style and effectiveness of communicating complex topics.

Stay tuned..





NetBeans Community Docs User Survey

15 07 2009

Take the NetBeans Community Docs User Survey

The NetBeans Community Docs program is a great source of community-authored content about using the NetBeans IDE. Now the team behind the program wants your feedback to help make the program even better. What type of content do you like? Do you want more tech tips or prefer multimedia material? Take the survey and let the team know!

Well, this is an important news item for the NetBeans Community, thus it was necessary to let the community know about it on large scale. Kristian Rink, NBCD Coordinator and its Evangelist setup the survey that contains almost every question, our team wants the community to answer.

Thanking you..





taT | Hacking Modules..

10 07 2009

Ever wondered, apart from extending the NetBeans IDE, or some application based on NetBeans Platform. What else can be done with the module?

Brief Overview

Well, NetBeans IDE provides Module Development Support by providing 4 kinds of Project Templates;

  1. Module
  2. Module Suite
  3. Library Wrapper Module
  4. NetBeans Platform Application

I have some knowledge of the first two, so we will stick to them for the rest of this post. So, lets have a look at the simplistic module structure;

Module Structure

This is what you see when you expand the Project node in Files View. We will focus on platform.properties, project.xml. If you switch to the Project View, you would see the files with following names, visible under Important Files node.

NetBeans Platform Config

So, that’s basically the logical view of the file platform.properties. In the past, I have written some pretty useful tips and Tricks (contributed to NetBeans Community Docs) based on this file;

  1. Configure Clusters and Modules
  2. Managing NetBeans Platforms

Project Metadata

This is the logical view of the file project.xml. There’s one more useful tips and Tricks (contributed), that’s based on this file, which lets you add your module as friends to those modules, if you want your module to depend on the specification version of the same.

NetBeans IDE 6.7 (Click to enlarge)

Playing Tricks..

I will be making use of NetBeans 6.7 IDE. Although, these tricks should work well with NetBeans 6.x IDE. So, lets answer the question I asked in the beginning.. Generally, when you create Module project, you get an option to either create it as Standalone Module or Add to Module Suite.

Standalone Module

When you choose this option, you also get an option to select NetBeans Platform of your choice, along with Manage.. button. If you want to know more about that, refer this contribution.

Suppose, I choose NetBeans 6.5 Build (added with name as 65 in Platform Manager) as Platform and move ahead. I would be able to use 6.7 IDE to create module, targeted for NetBeans 6.5 IDE. The module’s platform.properties looks like this;

nbplatform.active=65

This would enable the running IDE to achieve the desired result, as mentioned above. Now, running the module will ofcourse launch NetBeans 6.5 IDE as Target Instance to see how your module works. This process might be slow, as you’re running full-fledged 6.5 IDE.

NetBeans 6.5 boots with a b'day stamp on splash screen!

If your module doesn’t depend on clusters other than platform (which is by default). Then, you can tweak the file as follows;

enabled.clusters=\
 platform
nbplatform.active=65

These clusters are bare-minimum essentials, that are enabled by default when you create the NetBeans Platform Application project using 6.5/6.7 IDE. The property enabled.clusters helps to enable only those clusters which are necessary to run this module.

Splash Screen for empty NetBeans Platform Application

Now, run your module and it will look like you’re running a NetBeans Platform Application having a single user-defined module. Here’s how module’s project.xml looks like;

<project xmlns="http://www.netbeans.org/ns/project/1">
   <type>org.netbeans.modules.apisupport.project</type>
   <configuration>
      <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
          <code-name-base>code.name.base.of.your.module</code-name-base>
          <standalone/>
          <module-dependencies>
           <!-- Here are your module dependencies.. -->
          </module-dependencies>
          <public-packages/>
      </data>
   </configuration>
</project>

Note the bold-faced tag <standalone />, this tells the NetBeans IDE that your module is not part of any module suite. Its a standalone module, as you created.

Add to Module Suite

If you decide to go with this option, you would then browse the filesystem to find the appropriate Module Suite project and then, move ahead.

In case of Module Suite projects, the enabled.clusters property automatically occurs/disappears, when you check/uncheck the modules and/or clusters from its Project Properties Wizard.

Note that the module, that becomes part of the suite, would use only those clusters which the suite has enabled. Along with that, suite-private.properties file is added under /nbproject/private. Also, take a look at the module’s project.xml;

<project xmlns="http://www.netbeans.org/ns/project/1">
   <type>org.netbeans.modules.apisupport.project</type>
   <configuration>
      <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
          <code-name-base>code.name.base.of.your.module</code-name-base>
          <suite-component/>
          <module-dependencies>
           <!-- Here are your module dependencies.. -->
          </module-dependencies>
          <public-packages/>
      </data>
   </configuration>
</project>

Note the bold-faced tag <suite-component/>, this tells that NetBeans IDE that this module is part of a Module Suite project.

Tips to Remember

You may convert your standalone module to become part of suite, or vice-versa. Just add/remove suite-private.properties (Per Suite Locator) file and tweak your Module’s project.xml and Module Suite’s project.properties.

Also, note that some changes have taken place in NetBeans 6.7 IDE, you may find out more over the web. One more thing, NetBeans 6.5 IDE added suite.properties file under /nbproject and had same tag as <suite-component/>. I think NetBeans 6.0 and 6.1 might do the same. Please try it yourself and let me know.

Stay tuned..





taT | Hacking Project Properties

10 07 2009

Yesterday, I recreated one of the Visual Library Sample  (basically a tutorial based on it at Dzone) using NetBeans 6.7 IDE on Windows XP Professional SP2. The sample was Java Application that had two JAR’s (present in the platform7 cluster of NetBeans 6.0 IDE) in its classpath.

I followed the tutorial and successfully executed the application. Fortunately, I have NetBeans IDE from 5.5 onwards, so there wasn’t any issue finding the JAR’s and adding them in the application’s classpath.

I didn’t knew whether it will work with cluster from higher release or not. Hence, I decided to give it a try by making use of clusters from 6.1, 6.5 and finally, 6.7.

Playing Tricks..

Now, removing/adding JAR’s again and again can be boring/cumbersome if you have several releases stored under different hierarchies of your filesystem. So, I looked into the various files created under /nbproject to inspect how these JAR’s being referred.

When you right-click Libraries Node and click Add JAR/Folder..

right-click Libraries Node (Click to enlarge)

You’re prompted with the dialog for browsing and then, selecting Reference/Absolute Path as per your choice.

Browse to select platform7 cluster (Click to enlarge)

I selected the platform7 cluster (see above figure) and selected the JAR’s shown in the following figure.

Selected JARs from platform7 cluster

/nbproject/project.properties

This file contains all the project related properties, that are accessed by build-impl.xml (created from project.xml automatically) for necessary Ant operations.

file.reference.org-netbeans-api-visual.jar=\
  path\\to\\cluster\\modules\\org-netbeans-api-visual.jar
file.reference.org-openide-util.jar=\
  path\\to\\cluster\\lib\\org-openide-util.jar
includes=**
jar.compress=false
javac.classpath=\
 ${file.reference.org-openide-util.jar}:\
 ${file.reference.org-netbeans-api-visual.jar}:\
 ${libs.swing-layout.classpath}

The bold-faced text is added, once referenced JAR’s are added from Projects Window/Project Properties Wizard. Also, path\\to\\cluster refers to the directory where the platform cluster is stored. In case of the above application, here’s the path;

E:\\OpenSource\\NetBeans_Archies\\NetBeans 6.0\\platform7

Playing with Clusters

Now, as you can see the path\\to\\cluster is the same in this case. So, I introduce another property that will have the path as value.

path.to.cluster.platform=\
  E:\\OpenSource\\NetBeans_Archies\\NetBeans 6.0\\platform7
file.reference.org-netbeans-api-visual.jar=\
  ${path.to.cluster.platform}\\modules\\org-netbeans-api-visual.jar
file.reference.org-openide-util.jar=\
  ${path.to.cluster.platform}\\lib\\org-openide-util.jar

This way, the referenced JAR’s become dependent on this property. Now, one can also change the value of this property, i.e. if one is interested in using JAR’s from platform cluster of higher releases of the NetBeans IDE.

Then, NetBeans will automatically scan the project, to update dependencies. For instance, I opted for platform9 cluster from NetBeans 6.5 IDE.

path.to.cluster.platform=\
  E:\\OpenSource\\NetBeans 6.5\\platform9

I just made changes at one place, that will be automatically reflected in other properties that depend on it directly/indirectly.

Tips to Remember

However, you need to check your code, once you do these changes, as this might cause warnings on deprecated usage of certain API, when you build your application.

Also, if you do any error while editing your project.properties as for this scenario, or any other. You may end up seeing lots of error badges in your code and possibly, get an added menu item (Resolve Reference Problems..) in the project’s context menu.

Stay tuned..





Community Docs and NetBeans

1 07 2009

This is the first time, I thought of filing an issue for NetBeans Community Docs Program as I have never ever thought there would be a need for it, in the past 2 years. Generally, no one has ever done that, AFAIK.

I have been an active contributor to NetBeans Community Docs Program and managed it as coordinator for the duration of 11 months (May ‘08 – Mar ‘09). However, I feel there’s lack of coverage of the resources, that are gathered and arranged in the form of several wikis interrelated with each other in a systematic way.

Through this issue, I would like to see increased presence of NetBeans Community Docs in the NetBeans Community. I have some ideas which I would like to put forward, but first I want to see interest from your side (Community Members and NetBeans Team).

You’re welcome to add your comments/suggestions or even vote for this issue. See the following for latest updates.

Jul 14, 2009

Kristian Rink has setup a user survey. Please go and fill up the forms. We need your feedback, so that we can be in better position to decide the future of this program.

Jul 08, 2009

Kristian Rink has written a post discussing the future of the program and what does the community think about it? I feel you must go through it once.

Jul 03, 2009

Since VOC Captains have CC’ed themselves on issue report and I got reply from Michel. Here are I am sharing my ideas and related details;

Brief History

There are over 300 docs, right? When we reached 250 docs, I realized that there was findability issue. If I need a tutorial on how to make use of some feature, which is documented only by a community member and not by Sun writers. Then, user has to put some effort to locate that. Even I had that problem.

So, through mutual agreement, we created several category-specific wikis that would archive docs belonging to those categories. You may read more about that here;

http://nb-community-docs.blogspot.com/2008/11/netbeans-community-docs-reloaded.html

This way we were able to fix the findability issue, temporarily. Yes, temporarily! I thought, we were still missing a page which can provide pointers to all the sections of these category-specific wikis. So, I decided to setup a wiki;

http://wiki.netbeans.org/NBCDMatrix

that will do the needful. Now, if anyone wants (community contributed) tutorials on GUI Builder, just need to bookmark this link;

http://wiki.netbeans.org/NBCDMatrix#section-NBCDMatrix-SwingGUIBuilder

This contains a matrix which has necessary pointers to tackle the issue.

Ideas

Now, coming to the point of concern, i.e. the NetBeans Community Website doesn’t feature pointers to these wikis. As you might know that currently there’s only one pointer to the Community Docs Contributions list from relevant Learning Trails.

Instead, I would love to see a separate “Community Contributed Docs” Learning Trails, where one can have relevant information on how to access these wikis. Also, I would request the NB Team remove the following webpage;

http://www.netbeans.org/community/commdocs.html

Its better to have single Learning Trails page to focus on the above issue, rather than maintaining small sections on every Learning Trail and maintaining the above webpage. It will also ease the work spent by NB Team on such maintenance. Also, the proposed Learning Trail can also be pointed from User FAQs, Developer FAQs, etc.

If someone is unable to find  necessary info in these FAQs, then he/she may navigate to the trail to learn how to find out community contributed docs for their requirement. This should be good enough to make our presence felt in the community, as this Learning Trails would feature in Docs & Support page.

Thanks!





Blog Series and PrayogShala

1 07 2009

PrayogShala (New Blog)

I have some important news to share, I will contiuning some of the blog series (started here) at another blog. As announced yesterday, I have launched the new blog today.

Currently, there are two posts. One of the them, continues the series I started here with the following blogs;

Hope you will like this change. Also, I have changed the look of this blog as you would notice. Hoping I will continue to provide quality content on both blogs and interested readers may read more about the new blog.

Stay tuned..





James Gosling, NBDT Honorary Member

30 06 2009

I was wondering whether to blog this or not. However, I felt its important the NetBeans Community must know this. Last month at JavaOne, Sven Reimers who received Duke’s Choice Award, inducted James Gosling into the NetBeans Dream Team Wall of Fame. Thank you so much!

Sven Reimers and James Gosling, members of NetBeans Dream Team

Netbeans Dream Team Honorary Members

Honorary members are previous Dream Team members who opted out. They must be a Dream Team member for a continuous year before they are Honorary Members. They reserve the right to be a Dream Team guest at any time. The do not reserve the right to use the Dream Team logo in future works. They do not receive any software, hardware, clothing, or other material benefits which may or may not be given to Dream Team Members.

Other News

I have setup a new blog for my experimental work, I like to carry out either with NetBeans Platform or any other technologies. I will be announcing it tomorrow.

Stay tuned..





Hyperlink Navigation Renaissance | #2

29 06 2009

Last year, I had written a blog on Hyperlink Navigation Renaissance, here’s brief overview;

After lot of discussion on OpenIDE mailing lists, exploring Developer FAQ’s, exerting my wrist, flexing fingers and what not? Finally, hit the deck hard! Yeah, Hyperlink Navigation in NetBeans got smarter! Especially, for HTML documents.

That time, I had developed a plug in, which I have started to discuss about more these days. Yes, its Revamped Hyperlink Navigation and here are list of blogs discussing about it;

These blogs basically describe the history of this plug in, pointers to available resources at Kenai and how do I use SVN for managing the plug in source code from CLI, as well as from NetBeans IDE.

Now, I would like to tell you that there has been many changes since and I thought community would be interested to see the updates in the tutorial, I wrote last year. Have a look at this wiki for updates, rather than the entry at NetBeans Zone (If you want to, then see the comments for updates).

Changes done..

I have got rid of overloaded setPosition methods, instead there would be one method from now onwards. While, some of the methods were renamed and some are no longer parameterized. This has reduced lot of redundant code and now, the code looks really neat. Making use of various editor features to cut-short long line of codes has helped.

Also, I removed the parameterized constructor, instead introduced a public method to pass necessary parameters from HyperlinkProvider implementation. This was done so as to possibly introduce an interface, which the module would depend on, while its implementation is available in another module. Yes, I am trying to make use of Lookup API to achieve same result.

Only issues I have, that currently one module can only depend on another user-defined module within a suite project. However, module I created is standalone one and its not possible to depend on another module, AFAIK. If you know of ways to do so, let me know or join this project to work towards achieving this.

NetBeans 6.7 and Manage Platforms..

All of this was possible due to a feature I recently discovered in NetBeans 6.7 IDE, which was there in previous releases as well. However, I never really explored it. By the way, NetBeans 6.7 FCS is released. Check out the new, super cool homepage of NetBeans DOT org.

NetBeans 6.7 FCS released!

Stay tuned..





#3 | Geertjan Blogs and Kenai

16 06 2009

Dec, 2008

Nearly 6 months back,I had published 2nd part of the blog series, I started to share what I learnt while creating a project type. However, I couldn’t continue as I got busy with my internship commitments and engineering studies. I thought I would see many blogs after that from community side. I got few nods as well, but I am disappointed with them as they didn’t deliver.

May, 2009

I saw Geertjan wrote mini-blog-series (May, 2009) with code and hints on how to get started creating project type. That was really cool. Finally, it looked like my prayers were heard. Have a look at them;

  1. @AntBasedProjectRegistration
  2. @NodeFactory.Registration
  3. Build Project Command for Ant Based Project Types

Geertjan made use of NetBeans 6.7 daily builds for creating the prototype explained above. So, why not get started with these blogs?

June, 2009

I will soon continue with my exploration stopped long time back and will continue to post my learning in the coming months. Also, I have written a post in discussion forums to begin creating a project type.

Other News
Get to know more about my NetBeans plugins at Kenai and I also shared some tips and Tricks based on NetBeans Platform.

Come on, get started and share what you explore. Stay tuned for more..





SVN using CLI and NetBeans

15 06 2009

Recent exploration in the world of FOSS has helped me adopt SVN more easily than ever before. In this post, I will share some of my learnings about working with SVN using CLI and NetBeans.

Basically, I am going to map every possible command that were used on Command Line Interface (CLI), during past 2 weeks to the functionalities provided by Subversion Support in the NetBeans IDE (6.0+).

NetBeans IDE 6.7 RC2 (Click to enlarge)

Using 6.7 RC2 for demonstration,

After making project and their respective copies in the SVN repository of my plug in at Kenai. I forgot to update the /trunk after I had fixed a bug that was affecting plugin’s version v1.0, which was fixed for version v1.1. Actually, I had earlier made a tag by copying the sources from “/tags/release60_base/plugin-code-base” to “/tags/release60_fixes/plugin-code-base”.

I started fixing the code in the tagged repository before renaming/moving the repos to “/branches/release60_fixes/plugin-code-base”. Then, I realized that I had not merged the changes to the /trunk, which was required. So, we will see in the rest of this blog, how to do the merge using CLI and NetBeans IDE.

Using Command Line Interface

Now, I need the working copy of the code kept at /trunk, so I have to do a checkout, first.

svn checkout URL

You can learn more about the checkout from the book of Version Control with Subversion. I have substituted URL with https://kenai.com/svn/nbrcp-kolektiv~incubator/nbplugins/branches/release60_fixes in the above, as well as the following command(s).

Now, having read the common use-cases of Merging Whole Branch to Another in the book, I decided to give it a try using CLI. So, I did the following;

svn log --stop-on-copy URL

Here’s what the book states;

The log subcommand will normally show every change ever made to the branch, including tracing back through the copy which created the branch. So normally, you’ll see history from the trunk as well. The --stop-on-copy will halt log output as soon as svn log detects that its target was copied or renamed.

Now, this presents the required textual information, and I found out that copy was made in revision r25 and last commit was made in revision r32. Now, we know where the changes took place since making the copy of trunk in r25. As per the book, I used the following command to do the merge;

svn merge -r 25:32 URL

Firstly, change the directory to the working copy and if we use svn merge, it assumes that current directory is the working copy. So, it will apply changes that happened between r25-r32 to the working copy. It may happen that there might be some conflicts, which you can resolve from command line. Now, use the following to see the status and detect any conflicts of the working copy after merging has been done;

svn status

The console output shows only modifications (denoted by M), addition (denoted by A)/deletion (denoted by D) or conflicts (denoted by C). If there are any conflicts, they are required to be resolved. So, please refer this guide on how to resolve the conflicts using CLI. Once they are resolved, you should commit the changes to the server (/trunk).

svn commit -m some_message

where some_message = “Merged changes r25:32 into the trunk..”

Hit Enter button to send the changes to the server. The book states,

Again, notice that the commit log message very specifically mentions the range of changes that was merged into the trunk. Always remember to do this, because it’s critical information you’ll need later on.

Using NetBeans IDE

Now, I will show you how to do the same using NetBeans IDE to increase productivity, without worrying about typing issues that may occur using CLI. Also, changing directories, retrieving logs, doing manual merge, etc.

All of these may go easily wrong.. Although, its good to know how to work using CLI. Its much better to use IDE’s for the same purpose. Thus, I have written this blog that may help you switch to NetBeans IDE for the same.

Checkout..

Firstly, goto Team | Subversion menu and select Checkout… This will open a wizard where you will enter the URL, username and password. Now, refer this blog on how to checkout the code and configure it, as per the requirements. Once its done, project will be opened and displayed under Projects window.

Merge Changes..

Right-click the project node and select Subversion from the context menu. Then, select Merge Changes.. from the menu as displayed here;

Merge Changes.. (Click to enlarge)

Soon, following window opens that lets you configure the way you want the merge to happen and that too, in one step! Have  a look;

Merge Revisions (Click to enlarge)

You can see various options in the form of drop-down list and browse, search buttons. I willl brief you about the same as we move ahead. Drop-down list have three options to choose from;

Type I – One Repository Folder Since its Origin

Merge Revisions Type I (Click to enlarge)

Type II – One Repository Folder

Merge Preview Type II (Click to enlarge)

Type III – Two Repository Folders

Merge Revisions Type III (Click to enlarge)

So, I selected Type II because I want to merge changes from single repository folder (/branches/release60_fixes) which is other than the working copy, synchronized with (/trunk). This preview is shown within the same window and can be viewed by scrolling down the same window.

Browse.. will let you choose the repository folder to merge from. We will choose /branches/release60_fixes/ahrefhyperlink.revamped (This folder might change in future, you may expand /branches as shown in the figure to observe changes taken place) for merge. Have a look;

Browse Repository Folders (Click to enlarge)

At the beginning of this entry, I mentioned that one can find out that changes between which versions have to be merged in the working copy. To do that, one has to make use of svn log. In this case, one would just click the Search.. button and following window pop-up!

Log changes (Click to enlarge)

Clicking List will list all the changes that have occurred since the date entered in the shown field. As you can see tag was made in r25 and last code update took place in r32. So, we will first choose the revision #25 for Starting Revision and #32 as Ending Revision, one-by-one. See the following figure;

Merge Revisions (Click to enlarge)

This works same as the  svn merge command used earlier. Click Merge button to commence the merge operation. Once the merging is finished, one can see whether there are any conflicts or not.

Conflicts may occur, when the HEAD revision of the /trunk repository is not in sync with the other repository, when sources were first copied from /trunk. See the following figure, I got two file conflicts;

Merge Conflicts Part 1 (Click to enlarge)

For resolving conflicts, you may refer this guide written by Sun Technical Writers. Once conflicts are resolved, you must now commit the sources with this message as recommended earlier, “Merged changes r25:32 into the trunk”. That’s all for the day. Hope this helps you get started effectively.

Reference Guide
http://www.netbeans.org/kb/60/ide/subversion.html#merging





Jazoon ‘09: James Gosling is coming!

13 06 2009

James Gosling’s only 2009 European appearance

Jazoon is very proud to have James Gosling deliver the opening Keynote of Jazoon’09 in Zurich, Switzerland, in 10 days. This is your only chance to meet him in Europe in person this year and to directly hear his latest news.

So if you missed JavaOne this year, attend Jazoon’09 and benefit from inside information and updates, but also get latest news about the future of Java. We all know that there are major changes coming up and that’s why you should attend Jazoon’09 to stay current.

Besides James Gosling, Jazoon’09 features many other interesting speakers from the Java world including Neal Ford, Ivar Jacobson, Adrian Colyer and Danny Coward. As a special guest we are pleased to announce Linda Cureton, CIO of the National Aeronautics and Space Administration (NASA) Goddard Space Flight Center in the USA. She will deliver the Jazoon’09 closing Keynote.

Register now
https://jazoon.com/registration?l=en

See the full conference schedule
http://jazoon.com/en/conference/schedule.html

Conference schedule in Google Calendar and iCAL

Download sessions you are interested in into your calendar, iPhone or other devices. For the first time Jazoon offers the conference schedule as Google Calendar or iCAL-file.

Take a look at the Google Calendar
http://jazoon.com/en/iCAL.html

Jazoon Networking Groups

Follow Jazoon on twitter
https://twitter.com/jazoon

Jazoon on Xing
http://www.xing.com/group-26451.e1a44d

Jazoon on Facebook
http://www.facebook.com/group.php?gid=37011557820

Stay tuned for more..





NetBeans Plugins at Kenai | #2

10 06 2009

This post will focus on work flow of my plug in Revamped Hyperlink Navigation (RHN). Without much ado, lets get started..

Getting Started

Firstly, you need to access the existing sources available for plug in, published in Update Center for NetBeans 6.0 and then, I will use NetBeans 6.5 as the development software for demonstration. So, run NetBeans IDE (bundled with either Java SE, Java or All technologies).

NetBeans 6.5 boots with a b'day stamp on splash screen!

Checkout Sources..

Open Versioning | SVN menu and select Checkout… from sub-menu. Checkout Wizard opens.. Now, enter Repository URL as https://kenai.com/svn/nbrcp-kolektiv~incubator/nbplugins/tags/release60_versions and click “Next >.

You might be prompted by the NetBeans to accept certificate, click on Accept Temporarily and continue.. Now, click on the Browse button to select the Repository Folder needed to be checkout. Select /rhn_v11/ahrefhyperlink.revamped and specify your Local Folder. Also, select the checkbox with label as Scan for NetBeans Projects after checkout and click Finish. NetBeans will prompt you to open project AhrefHyperlink (Revamped). Click Open Project and NetBeans will open the project for you. Now, right-click the project node and select Properties.

Reference Guide
http://www.netbeans.org/kb/60/ide/subversion.html#checking

Manage Platforms…

Now, goto Libraries and you will notice that NetBeans Platform selected for project is the default build provided by the NetBeans 6.5 IDE, and similarly for Java Platform. So, you need to configure the project to be built against NetBeans 6.0. Therefore, refer this tips and Tricks to learn how to “Manage Platforms…“. Also, choose JDK 1.5 for Java Platform (JDK 1.6 should also work fine).

See Module in Action..

Once you are done with it, click OK to save project properties. Now, Clean and Build the project and Run to see this module in action. If success, the NetBeans 6.0 splash screen pops up and soon, NetBeans 6.0 instance is running with the plug in, installed. Try out the cases specified in the tutorial and then, try out some new one’s from your side. Observe where it works and where it doesn’t.

If you find any issues/bugs, kindly file it using JIRA Issue Tracker used for this project and select component nbm-hyperlink. Soon, I will write wikis so as to help you understand how to file issues for this project. Fixed sources are stored under /nbplugins/branches as /release60_fixes/ahrefhyperlink.revamped (Links updated).

Unstable code is placed under /nbplugins/trunk and you may see what new developments take place there.

Stay tuned for more!





Configure NetBeans using Batch Files..

7 06 2009

Well, we all know that although editing “{netbeans.home}\etc”\netbeans.conf is not a big deal for any developer, it certainly takes a toll, if you’re using daily builds. That means, everytime you download new build of NetBeans you will modify the configuration file to tune JVM switches as per your operating system.

Last year, when I participated in NetCAT 6.5, I had this problem, i.e. I did the same configurations again and again, every time I downloaded latest build. Recently, when I downloaded 6.7 RC1 to make use of Kenai and Hudson integration, few days later I got the notification of 6.7 RC2 and related CA survey. Today, I downloaded that too, but it makes me feel sick to do those configurations all over again.

CLI (Command Line Interface)

There are people who write many scripts to ease their work by automating some tasks. As I was not good at using CLI, as I am right now. So, I thought of giving it a try and I looked into the internet to learn some batch programming. After exploring for some amount of time, I have written a batch program to help me with the task and here’s what I got;

for /d %%X in (%1\NetBeans*) do edit "%%X\etc\netbeans.conf"

Explanation

This batch program has got only the for-statement and this is where I look for NetBeans installation directories stored under the directory provided as a runtime argument denoted by %1 For instance, I have installed 6.7 RC1 and RC2 under C:\Program Files. So, I will make use of this batch program on CLI like this;

nbconfig "C:\Program Files"

Now, the batch program loops through this directory passed as a runtime argument and will look for the right installation directory by making use of NetBeans* as matching criteria. Once it finds the directories, it will loop each one of them, one-by-one and open the configuration file for editing.

Dis/Advantages

That’s the benefit that you just have to pass the directory (under which such directories could be found) and Windows will automatically open the configuration file for editing, if you feel its already edited before. Just perform action (Alt-F | Exit) to exit editor and to automatically switch over to the another configuration file.

There’s a limitation that if there are 10 installation directories under one directory (passed as runtime argument) and you have already made modifications to 6 of them, you will have to pass each one of them, before you could actually make modifications to the last 4.

Comments/Suggestions

You’re welcome to improve upon this and suggest changes to be made for benefit of the community. I think it won’t be difficult for Unix experts to write a shell script for the same, or probably come out with a better solution. Also, I have started to make use of Subversion using CLI (along with NetBeans support), interested readers can refer this blog for more info.

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.

Hope that helps, stay tuned for more..





taT | Managing NetBeans Platforms

3 06 2009

Recently, I asked a question on NetBeans Developers Mailing List about gaining better understanding of managing NetBeans Platform(s) within the NetBeans IDE.

You didn’t knew that, right? Well, I have also recently discovered that there’s a provision to manage “NetBeans Platforms” for almost every NetBeans Module Project (I guess). Although, I think I knew that this feature was there but never actually devoted time to see what exactly it does.

Yesterday, when I re-discovered this feature and decided to give it a try. I started exploring it and then, faced some issues. So, I raised the above question on the mailing list. I did receive a reply, however it has a different approach to the above problem. Not directly related to scenario’s I came across. As I await more clarification

Now, I got clarification I needed and indeed it should help me understand the way, NetBeans works in this scenario. I thought why not share this scenario with you people. Maybe, you might have faced same issues.

So, how exactly we make use of this feature? Just follow the steps and let me know, what did you observe?

Here are the Tricks,

Firstly, run NetBeans IDE (bundled with either Java SE, Java or All technologies). I am using NetBeans 6.5 FCS for demonstration.

NetBeans 6.5 boots with a b'day stamp on splash screen!

Now, goto Tools | NetBeans Platforms and generally, you would find same platform configured with your NetBeans IDE and that might be possible, only if you are not running any daily builds.

Click to enlarge!

So, this figure might look familiar to you, if the above statements are correct. You can configure several platforms with your distribution. For instance, I have NetBeans 6.0, 6.1 installed, along with 6.5 which I am running. So, I will show you how to configure one of them,

Add Platform…

Click to enlarge!

Choose Platform Folder

This step will let you select the installation directory of other NetBeans distributions and let you configure the platform supplied by them.

Click to enlarge!

Platform Name

You may edit the Platform Name as per your need, or keep defaults and click Finish.

Click to enlarge!

This way you have added platform supplied by NetBeans 6.0 in NetBeans 6.5. Now, switch over to Harness tab and click the 2nd radio button to complete the configuration. This is done to let this platform use its harness to perform tasks related with module projects.

Click to enlarge!

Similarly, doing for 6.1, the following figure shows that I have successfully configured the above NetBeans Platforms,

Click to enlarge!

Now, you know how to add/remove NetBeans Platforms. Lets go further ahead and explore a bit more by taking a typical scenario..

and some tips,

Assuming you made a plug in using NetBeans 6.0 (released in Dec ‘07) to be compatible with the same. Soon after NetBeans 6.5 FCS (released Nov ‘08) was available, you find that 6.5 work very fast compared to 6.1 and due its improved features, it will help you in reducing your development time.

So, you decide to rework on your module using latest features, however you still want that plug in to work only for NetBeans 6.0, here’s what you need to do.

Firstly, open your plug in project and right-click project node to select its properties. Now, goto Libraries and you would see there’s a drop-down list for selecting your choice of NetBeans Platform, against which you can build your module. This list of platform’s can be configured by clicking “Manage Platforms…” button and you will see the same image, shown earlier.

See how they are all related.. Isn’t it cool? By default,  the platform supplied by the NetBeans IDE you are running is selected.

Here’s one thing to keep in mind, that as you are reworking on an old project like this, you must make sure that you configure the NetBeans Platform for it with care, as not doing so will result in failing the build and adding irrelevant versions of module dependencies.

In our case, if you have configured NetBeans 6.0 as demonstrated above, you need to select that from drop-down list and then, select NetBeans 6.0 build to let your module perform tasks against platform supplied with NetBeans 6.0.

Click to enlarge!

When, you run the module project, the above splash screen for NetBeans 6.0 pops up and now, you can see whether your module works or not. Hope this helps!

This blog has been contributed to NetBeans Community Docs Program and for latest updates on this content, refer to the contribution.

Acknowledgements

Thanks to Tom Wheeler (NetBeans Dream Team Member and NetBeans Governance Board Member) for answering my question on the mailing list.