Class CrudListPanel<T extends ILightObject>

Type Parameters:
T -
All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
PeriodsPanel, PersonsPanel, SchoolClassesPanel, SchoolsPanel, StudentsPanel, TeachersPanel, YearsPanel

public abstract class CrudListPanel<T extends ILightObject> extends JPanel implements PropertyChangeListener
Since:
1.0 Oct 24, 2008, 1.0
Version:
%I%, %G%
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • CrudListPanel

      public CrudListPanel(JPanel homePanel, boolean sortable)
    • CrudListPanel

      public CrudListPanel(JPanel homePanel)
    • CrudListPanel

      public CrudListPanel()
  • Method Details

    • finalize

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

      protected abstract AbstractLoLoader<CrudListPanel.LoadListWorker> getListLoader()
      Returns:
      the loader called to load items in an other thread (asynchronous call, allows showing progress)
    • getInfoPanel

      protected abstract IItemPanel<T> getInfoPanel()
      Concrete panel to display the item infos
      Returns:
    • getEditPanel

      protected abstract IItemEditor<T> getEditPanel()
      Concrete panel to edit item informations
      Returns:
    • loadItemAsync

      protected abstract T loadItemAsync(int itemId, boolean lazy)
      Loads an item in an other thread (asynchronous)
      Parameters:
      itemId -
      lazy -
      Returns:
    • getLogo

      protected abstract Image getLogo()
      Representation of the item type Preferred size is a with of 130, and a height of 100 px.
      Returns:
      Image
    • deleteItem

      protected abstract void deleteItem(ILightObject lo)
      Prompt for deletion confirmation, and execute all needed operations to delete the item.
      Parameters:
      lo -
    • showItemPopup

      protected void showItemPopup(int x, int y)
      Override this if you want to customize the JPopupMenu items before displaying it. Displays the popup menu at the position x,y in the coordinate space of the component invoker (the item list).
      Parameters:
      x - the x coordinate in invoker's coordinate space at which the popup menu is to be displayed
      y - the y coordinate in invoker's coordinate space at which the popup menu is to be displayed
    • showLoadingProgress

      protected void showLoadingProgress(boolean show)
    • showCard

      public void showCard(CrudListPanel.ManagementCard card)
    • loadItemsList

      public void loadItemsList(boolean addToSelected)
      Loads asynchronously items for the list selection panel
      Parameters:
      addToSelected - false to clear the list before loading to avoid duplicates
    • loadItemsList

      public void loadItemsList(boolean addToSelected, CrudListPanel.ManagementCard finalScreen)
      Loads asynchronously items for the list selection panel
      Parameters:
      addToSelected - false to clear the list before loading to avoid duplicates
      finalScreen - Panel to display when the asynchronous loading will be done
      Since:
      0.0.9-SNAPSHOT Oct 12, 2010
    • getSelectedItem

      protected ILightObject getSelectedItem()
    • isLoading

      public boolean isLoading()
      Returns:
      the loading
    • getEditItemAction

      public AbstractAction getEditItemAction()
      Returns:
      the action to edit an Item
    • getDeleteItemAction

      public AbstractAction getDeleteItemAction()
      Returns:
      the action to delete an item
    • getShowOptionsAction

      public AbstractAction getShowOptionsAction()
      Returns:
      the action to show the CRUD options
    • getShowHomeAction

      public AbstractAction getShowHomeAction()
      Returns:
      the action to show home panel
    • getAddItemAction

      public AbstractAction getAddItemAction()
      Returns:
      the action to add an item
    • propertyChange

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

      protected void setLanguage()
      Since:
      0.0.4-SNAPSHOT (Feb 19, 2009)