Posted by claudio
on May 3, 2006 at 10:30 PM PDT
I am not a huge fan of scripting languages to do professional work (maybe some perl and bash has their niche). But one that helps me a lot is the interactive console of BeanShell, where I can type code and press enter, that's it, the code runs fine. But I needed to launch it as an external app. So I took some spare time to make the console as a NetBeans module to run it inside the IDE. Visit the blog entry to read the entire description and download the modules.
A while back NetBeans made available coyote project to enable developers write code in dynamic languages. Actually it supports Groovy and Jython . But it doesn't supports BeanShell which I am a fan, specially because of the interactive shell console .
The shell console let's you type code and execute it when the 'enter' key is pressed, so it's a shell console. (ok I know someone will remember me of Groovy console, but the different point is the beanshell console is interactive, groovy console is not). There is an old module for netbeans , but it doesn't enable the shell console and runs beanshell 1.2b5, the actual version is 2.0b4
To use the BeanShell shell console, it was launched from command-line. So I though "this can be a topcomponent of netbeans...", then I developed this small module to launch the shell console inside netbeans, easy.
The module development costs me more time to believe it was so easy, than to the development itself. It took more time to discover some beanshell internals. As I knew that, I just created a Module Suite, a Library Wrapper and WindowComponent , all of them wizards from NetBeans Module Development support.
So I tell you, if you want any jcomponent as part of netbeans workspace, so you are lucky, just use the WindowComponent Wizard, and type this at the constructor:
So I won't bother you anymore, take a look at the screenshot:
View larger image
Actually the module is very simple, just the shell console.
- only one window can be opened
- the same window is reused, no matter if the actual is closed
and download the modules:
br-com-claudius-netbeans-bsh.nbm NetBeans Module
bsh.nbm (BeanShell Library Wrapper)
Any comment is welcome and thank you for the interest.