A very handy plugin, in my humble opinion since I created it myself, is the Entity Expander. (Earlier blog entries are available on this, e.g., here.)

Take a look at this plugin if you're doing POJO-based development, i.e., plain old Java objects are the starting point of something larger, via some kind of framework or other technology. Right-click on any Java class and apply a template to it:

For example, if you have a POJO named "Person", with two String fields, named "name" and "city", and then choose "Vaadin Form" above, all of the below will be generated:

package personmanager1;

import com.vaadin.ui.Component;

import com.vaadin.ui.FormLayout;

import com.vaadin.ui.TextField;

import org.vaadin.maddon.fields.MTextField;

import org.vaadin.maddon.form.AbstractForm;

import org.vaadin.maddon.layouts.MVerticalLayout;

public class PersonForm extends AbstractForm {

private TextField name = new MTextField("name");

private TextField city = new MTextField("city");

@Override

protected Component createContent() {

return new MVerticalLayout(

new FormLayout(

name,

city

),

getToolbar()

);

}

}

Either use an existing template or one that you create yourself. (Feel free to add more templates to the sources on GitHub.) You'll see placeholders are available so that you can create your own extender template. If you click Create above, you'll need to specify a name, and then you'll get a template in the editor like this, which you can tune:

package ${package};

import javax.swing.JFrame;

public class ${object}Frame extends JFrame {

<#list fieldsAndModifiers as field>

${field};

</#list>

public ${object}Frame() {

}

}

Also, when you go to Tools | Templates, you're able to edit the templates defined by the plugin, as well as those you create yourself:

The plugin is ready to be used in NetBeans IDE 8.1:

http://plugins.netbeans.org/plugin/53874/entityexpander

Its sources are available on GitHub, you are welcome to fork and extend however you like:

https://github.com/GeertjanWielenga/EntityExpander

It has been approved by the NetBeans verification community and can therefore be installed via the Plugin Manager, which you can get to via Tools | Plugins:





Indeed, the display name and description could be a lot better, will work on that for the next release of the plugin.

Your feedback is more than welcome!