Download NetBeans!

20070515 Tuesday May 15, 2007

JavaScripting NetBeans

In one of the blog entries I wrote during JavaOne, I mentioned that I'd bumped into NetBeans architect Pavel Buzek, who was playing around with JavaScript and the NetBeans APIs. Since JDK 6, it is possible to run JavaScript in the NetBeans IDE's editor. Just right-click in the editor when a JavaScript file is open, if you're running on JDK 6 or above, and you'll see a "Run" menu item. Now, with the stuff that Pavel Buzek showed me, however, you're also able to run the NetBeans API classes from a JavaScript file.

Here's an example, for opening a file in the IDE (or any application on the NetBeans Platform):

How might this be useful? Quick prototyping, for example. No longer a need to create a NetBeans module project, no need to compile it, no need to install it. Probably there will be many scenarios that haven't been thought of yet, where this functionality will be useful.

Read more about it here, in Pavel's own words with several other examples, on the NetBeans Wiki:

http://wiki.netbeans.org/wiki/view/ScriptingNetBeans

In other news. Did you miss my mini-talk at the java.net booth during JavaOne? (Only about 15 people in the world can honestly say "No" to that question.) Fear not! Here's a podcast on java.net, that features my mini-talk. Also a cool pic of me in action, all on today.java.net.

May 15 2007, 11:21:09 AM PDT Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/javascripting_netbeans
Comments:

Also see: http://blogs.sun.com/jglick/entry/jrunscript_in_a_target_vm If I have some time I plan to make a java.net project for this tool.

Posted by Jesse Glick on May 15, 2007 at 12:37 PM PDT #

MS always had an object model for Visual Studio:

http://msdn2.microsoft.com/en-us/library/za2b25t3 (VS.80).aspx

There needs to be a similar object model for the NetBeans to make it easy to do scripting.

Posted by 24.6.40.69 on May 15, 2007 at 11:30 PM PDT #

Actually I did something like that in my scripting module. I had higher level objects like Window, etc. I also integrated the scripting engine into Jackpot so you can create Jackpot refactoring in any scripting language.

Posted by Chuk Lee on May 16, 2007 at 01:53 AM PDT #

I'm not pretty much a fan of scripting languages, but with some changes it could be good for writing automated GUI tests...

Posted by Fabrizio Giudici on May 18, 2007 at 08:32 AM PDT #

Much appriciate

Posted by Iresh Rupasinghe on September 18, 2007 at 05:05 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed