Class AbstractCrudPanel<T extends ILightObject>

Type Parameters:
T -
All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
AbstractCrudListPanel

public abstract class AbstractCrudPanel<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

    • AbstractCrudPanel

      public AbstractCrudPanel(JPanel homePanel)
    • AbstractCrudPanel

      public AbstractCrudPanel()
  • Method Details

    • finalize

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

      protected abstract AbstractLoLoader<AbstractCrudPanel.LoadListWorker> getListLoader()
      Example of implementation
              if(loader==null){
                      loader = new PersonsLoader();
              }
              return loader;
              
      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(AbstractLightObject lo)
      Prompt for deletion confirmation, and execute all needed operations to delete the item.
      Parameters:
      lo -
    • getResultsTable

      protected abstract JComponent getResultsTable()
    • isItemSelected

      protected abstract boolean isItemSelected()
    • clearList

      protected abstract void clearList()
      Clear the list of items.
    • addItem

      protected abstract void addItem(Object[] data)
      Adds an item into the list
      Parameters:
      data -
    • clearListSelection

      protected abstract void clearListSelection()
    • getSelectedItem

      protected abstract AbstractLightObject getSelectedItem()
    • 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(be.gaudry.swing.crud.AbstractCrudPanel.ManagementCard card)
    • loadItemsList

      public void loadItemsList(boolean addToSelected)
    • isLoading

      public boolean isLoading()
      Returns:
      the loading
    • propertyChange

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

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