Bean Properties Editor for JDeveloper 11g
Posted in JDeveloper on December 2nd, 2009 – 2 CommentsI developed beans with setter and getter methods frequently. And of course it is tedious to write code repeatedly for every bean’s properties.
How many key strokes for a single bean property? Too many as you guest.
In JDeveloper 10g, there is extension called Simple Java Bean Editor to allow developers to edit bean’s properties easily.
However, there is no one for JDeveloper 11g. That is one of reasons I decided to develop a new one.
Another reason is our projects require property change supports, the bean should fire property change event when setting new value to a property. Specially, gwtXP’s data binding rely on JFace data binding which in turn requires property change supports for model – UI widget synchronization.
The new Bean properties Editor (beanped) has following features:
- Functionality to edit bean properties
- Property change supports
Installation
- Download it in the Downloads page
- In JDeveloper 11g select menu Help -> Check for Updates
- In the step 2 of “Check for Updates” wizard select “Install from Local File”
- Click Browse button and select the downloaded file.
- Review the license and click button “I Agree”
- Click button “Next” and then “Finish”
Note: After installed, for your convenience, the Bean Properties Editor will create a new Update Source in the JDeveloper. When a new version is released, your JDeveloper will notify you to perform the update.
Using Bean Properties Editor

Figure 1. Bean Properties Editor screen shot – Bean Editor tab

Figure 2. Bean Properties Editor screen shot – Bean Editor screen

Figure 3. Add Property dialog
- Open the bean Java source file. See the figure 1 above.
- Click on “Bean Editor” tab. You will see the screen as in the figure 2 above. Just a simple user interface, there are two buttons and a table for list of properties at the bottom.
- To add a new property: Click “Add” button, input the property name and the property type. You can select/deselect check boxes “Generate Read Method” and “Generate Write Method”. Click OK button when done
- To remove a property: Select the property you want to remove and Click “Delete” button
- To add/remove the property’s Read method: Select/deselect the check box in the Read column in the properties list
- To add/remove the property’s Write method: Select/deselect the check box in the Write column in the properties list
Generated code
With few key strokes and mouse click, the Bean Properties Editor generates following code
package com.gdevelop.samples.bean;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
public class Student {
private String name;
private transient PropertyChangeSupport changeSupport =
new PropertyChangeSupport(this);
public Student() {
}
public String getName() {
return this.name;
}
public void setName(String name) {
String oldName = this.name;
this.name = name;
changeSupport.firePropertyChange("name", oldName, name);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void addPropertyChangeListener(String propName,
PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(propName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
public void removePropertyChangeListener(String propName,
PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(propName, listener);
}
}
Feedback and new feature requests
I hope this JDeveloper’s extension is helpful and appreciated for you feedback and/or features requests.
Leave a Comment »

