Class PersonEditPanel

All Implemented Interfaces:
IItem<Person>, IItemEditor<Person>, IItemPanel<Person>, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class PersonEditPanel extends JPanel implements IItemEditor<Person>, PropertyChangeListener
Since:
1.0 Oct 13, 2008, 1.0
Version:
%I%, %G%
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Field Details

    • noPhoto

      public final Image noPhoto
  • Constructor Details

    • PersonEditPanel

      public PersonEditPanel()
    • PersonEditPanel

      public PersonEditPanel(CrudListPanel<? extends Person> personsPanel)
    • PersonEditPanel

      public PersonEditPanel(CrudListPanel<? extends Person> personsPanel, boolean showSaveButton)
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • setItem

      public void setItem(Person person)
      Description copied from interface: IItem
      Give an item to the view
      Specified by:
      setItem in interface IItem<Person>
    • data2view

      public void data2view()
      Description copied from interface: IItemEditor
      Gets data from the item object and set the view components with it
      Specified by:
      data2view in interface IItemEditor<Person>
    • saveOrUpdateItem

      public Person saveOrUpdateItem()
      Description copied from interface: IItemEditor
      Calls the persistent layer to save or update the current item.
      This method may be invoked by the ManagementPanel
      Specified by:
      saveOrUpdateItem in interface IItemEditor<Person>
      Returns:
      saved item (the persistent layer will probably set the id if a new item is saved)
    • view2data

      public void view2data()
      Description copied from interface: IItemEditor
      Gets data from the view, and sets the item data with it
      Specified by:
      view2data in interface IItemEditor<Person>
    • getItemName

      public String getItemName()
      Specified by:
      getItemName in interface IItemPanel<Person>
      Returns:
      a user readable name (ie person, actor,...)
    • getPanel

      public JPanel getPanel()
      Description copied from interface: IItemPanel
      Mostly implemented like this :
      public JPanel getPanel(){
              return this;
       }
      because we cannot inherit from JPanel for an interface, but we must insert the implemented class in a container.
      Specified by:
      getPanel in interface IItemPanel<Person>
      Returns:
      the panel
    • getItem

      public Person getItem()
    • getPersonPictureFile

      public File getPersonPictureFile()
      Returns:
      the studentPictureFile
    • getSaveAction

      public AutoLocalizedAction getSaveAction()
      Returns:
      the saveAction
    • main

      public static void main(String[] args)
      Auto-generated main method to display this JPanel inside a new JFrame.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • setLanguage

      protected void setLanguage()
      Since:
      1.0.2-SNAPSHOT (Feb 21, 2009)