Jalcedo Java Beans Editor Generator
Jalcedo Java Beans Editor Generator is Eclipse plug-in to generate a simple POJO editor using SWT/JFace.
It generates the basic editor that has functions of CRUD (Create, Read, Update, Delete) for the selected Java Beans.
See also ItemEditorInMemory.
Requirements
How to use Java Beans Editor Generator
1. Create new RCP project
Create new project for RCP by selecting Plug-in Project
- File > New > Project...
- Select Plug-in Project -> Next
- Input Project name -> Next
- For the option Rich Client Application. Select Yes -> Next
- Select the RCP application with a view template -> Finish
2. Define model
Define a model as java beans and add PropertyChangeSupport?.
Example of model class is here.
package org.jalcedo.client.jface.examples.models;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
public class Item {
private long id;
private String name;
private int price;
public String getName() {
return name;
}
public void setName(String name) {
String oldValue = this.name;
this.name = name;
firePropertyChange("name", oldValue, this.name);
}
// getter, setter and ProertyChangeSupport methods.
}
3. Generate Jalcedo Beans Editor
- Right-click on the entity class and select New > Other...
- Select Jalcedo > Java Beans Editor -> Next
- Input Source folder, Package and Target Bean -> Next
- Selected bean informations are displayed at default.
- add jalcedo library. : add org.jalcedo.client.jface library to the project.
- register generated view extension.: generated view is registered to plugin.xml.
- Select ID property -> Finish
- Beans Editor is generated.
- conrrollers :
- events :
- models :
- views :
4. Describe ViewID in the Perspective file
Implements IPerspectiveFactory, and define view ID.
Default value of the ViewID is same as FQDN.
- (package name)+ ".views." + (target bean name) + "View"
see plugin.xml file.
(Example)
- Open Perspective class.
- Describe "import (packageName).ItemView?".
- Edit "!View.ID" to "ItemView.ID".
package org.jalcedo.client.jface.examples;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.jalcedo.client.jface.examples.views.ItemView;
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.setFixed(true);
// layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 1.0f, editorArea);
layout.addStandaloneView(ItemView.ID, false, IPageLayout.LEFT, 1.0f, editorArea);
}
}
5. (Test)Run Beans Editor
You can test genarated RCP Application from the Plug-in Manifest editor's Overview page.
- Open Plug-in Manifest Editor.
- Overview -> Testing -> Lanch an Eclipse application
Attachments
- Item.java (1.7 kB) -
example model
, added by nozawa on 06/29/07 15:32:51.
