 |
Got JavaBeans? Here's a way to distribute them...
Posted by timboudreau on April 03, 2006 at 11:53 AM | Comments (10)
BeanNetter - the NetBeans Module Generator
So NetBeans has this cool component palette from which you can drag and drop components onto Swing
forms. But where are all the cool components? NetBeans just shows the default JDK Swing components - but there are lots of components out there. Wouldn't it be nicer if you could make them just appear in your IDE? And there are sites such as nbextras.org with NetBeans plug-ins, and there is an update facility built into NetBeans - so why shouldn't you be able to download JavaBeans straight into the IDE from them? Well, first, it needs to be easy to create a NetBeans module that embeds JavaBeans and puts them on the Component Palette.
So I wrote a small tool that generates a NetBeans plugin. It's a wizard, and you point it at a JAR file with some Swing components in it. It finds all the declared JavaBeans that are there, and lets you choose to add or remove other classes. Then it asks for some info like the name of the library - this will be your Beans' category on the Component Palette.
When you complete it, it generates a complete, redistributable NetBeans Module (.nbm file - the distribution format for plug-ins - a glorified zip file), and all of the components you selected will show up on the Component Palette in their own category as soon as you install it in the IDE. Now...how to distribute these glorious plugins?
What to do with the results
Now you've got a module, but the point is to get that module to other people. How to do that? Well, first, if the components are open source, I bet the folks at nbextras.org would happily host them, and that site's been getting a lot of attention lately. If they're commercial, there is the Third Party update center that every release copy of NetBeans checks for plug-ins, and that could be a good place - the partner page would be a good place to start.
Sources and Screen Shots
Sources are in contrib/Beans2nbm/beans2nbm in CVS on NetBeans.org.
The tool also happens to showcase one of my (far too many) weekend projects, the Wizard project.
BeanNetter - the NetBeans Module Generator
Choosing a License - Extra points if you can identify the text above
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Thanks, Tim: this is GREAT STUFF!!!!
Posted by: vieiro on April 03, 2006 at 12:36 PM
-
Nice work. A nice to-do would be to catalog existing beans on Sourceforge, Freshmeat, java.net that are under FOSS licenses and help the owners package them in JARs for easy tryout and distribution. Ahh, another task...thanks for the new tool. Patrick
Posted by: pdoubleya on April 03, 2006 at 01:39 PM
-
that's great!
SwingLabs is on the component palette now!
Posted by: pprun on April 03, 2006 at 07:33 PM
-
Tim this is great!
I just tried it out and don't have time to do any CVS update right now, but I believe there is a small typo on line 71 of ModuleXMLModel.java:
buf.append ("false\"\n");
should be
buf.append ("false\n");
Thanks!
Matt
Posted by: mattjvincent on April 04, 2006 at 06:42 AM
-
Oops...typo myself :)
buf.append ("<param name=\"eager\">false</param>\"\n");
should be
buf.append ("<param name=\"eager\">false</param>\n");
Posted by: mattjvincent on April 04, 2006 at 06:44 AM
-
Fixed - thanks.
Posted by: timboudreau on April 04, 2006 at 11:35 AM
-
pls send me the .ndb file to theanuradha@gmail.com coz i cant creat it Thanks
Posted by: the_shakthi on April 06, 2006 at 03:03 AM
-
Update: There is now a new version which includes an Ant task. So you can simply make generating a NetBeans module for any library or component part of its build script.
Posted by: timboudreau on February 07, 2007 at 11:09 PM
-
Help me Please ! How Can I Custom Property Editors in netbeans ?
I have a class for which there is no standard property editor
such as this:
class A
{
private String Name;
public String getname()
{
return Name;
}
public void setname(String Name)
{
this.Name=Name;
}
}
class B
{
A a;
String myName;
.........
}
When I edit B's a property i can edit it with my Custom Property Editors ,How Cant I do that?
Thanks ,
nanningxiaoxu@yahoo.com.cn
Posted by: nanningxiaoxu on June 24, 2007 at 11:55 PM
-
You want to ask this question on the NetBeans nbdev mailing list, not here. You can access it also with a newsreader from news.gmane.org. In short, the answer is, provide a proper beaninfo, or if you're embedding your component in a module, add the package of the property editor to the search paths via java.beans.PropertyEditorManager
Posted by: timboudreau on June 26, 2007 at 12:30 AM
|