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.

class CustomerEditPanel extends EntityEditPanel {

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

  @Override
  protected void initializeUI() {
    create().textField(Customer.FIRSTNAME);
    create().textField(Customer.LASTNAME);

    setLayout(gridLayout(2, 1));

    addInputPanel(Customer.FIRSTNAME);
    addInputPanel(Customer.LASTNAME);
  }
}
See Also: