Class EntityEditPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class EntityEditPanel extends JPanel
An abstract UI component for editing a single entity, based on a SwingEntityEditModel.

The edit model is a thin context-carrier; the panel's working surface is the SwingEntityEditor (accessible via editor()) — it holds the edited values, the validation state and the insert/update/delete tasks. Subclasses implement initializeUI() to create and lay out the input components.

   public class CustomerEditPanel extends EntityEditPanel {

       public CustomerEditPanel(SwingEntityEditModel editModel) {
           super(editModel);
       }

       protected void initializeUI() {
           create().textField(Customer.NAME);
           create().textField(Customer.EMAIL);

           setLayout(new GridLayout(2, 1, 5, 5));

           addInputPanel(Customer.NAME);
           addInputPanel(Customer.EMAIL);
       }
   }
See Also: