Class FormattedListDisplay<T>

java.lang.Object
name.matthewgreet.strutscommons.view.FormattedListDisplay<T>

public class FormattedListDisplay<T> extends Object
Model bean, passed to JSP, that stores list and index of currently, selected item.
  • Constructor Details

    • FormattedListDisplay

      public FormattedListDisplay()
      Default constructor.
  • Method Details

    • getEndMasterIndex

      public int getEndMasterIndex()
      Returns index of last item in current page relative to master list that backs it (which starts at index 0). This is -1 if there are no entries, or list size - 1 if not in page mode.
    • getHasSelectedItem

      public boolean getHasSelectedItem()
      Returns whether there is a currently selected item.
    • getList

      public List<T> getList()
      Returns list for display, which may be a page if in page mode.
    • setList

      public void setList(List<T> value)
    • getListSize

      public int getListSize()
      Returns size of list. This exists because JSP EL can only read data if presented as a Java bean property.
    • getPageMode

      public boolean getPageMode()
      Whether list should be displayed in pages.
    • setPageMode

      public void setPageMode(boolean value)
    • getPage

      public int getPage()
      Returns current page number, starting at 1. Only useful if in page mode.
    • setPage

      public void setPage(int value)
    • getPageEndIndex

      public int getPageEndIndex()
      Returns index of last item in current page of list (which starts at index 0). This is -1 if there are no entries, or list size - 1 if not in page mode.
    • getPageSize

      public int getPageSize()
      Returns size of pages. Only useful if in page mode.
    • setPageSize

      public void setPageSize(int value)
    • getPageStartIndex

      public int getPageStartIndex()
      Returns index of first item in current page of list (which starts at index 0). This is -1 if there are no entries, or 0 if not in page mode.
    • getTotalItems

      public int getTotalItems()
      Returns total number of items.
    • setTotalItems

      public void setTotalItems(int totalItems)
    • getTotalPages

      public int getTotalPages()
      Returns total number of pages. Only useful if in page mode.
    • setTotalPages

      public void setTotalPages(int value)
    • getSelectedIndex

      public int getSelectedIndex()
      Returns index of currently selected item relative to current page, stating at 0.
    • setSelectedIndex

      public void setSelectedIndex(int value)
    • getSelectedMasterIndex

      public int getSelectedMasterIndex()
      Returns index of currently selected item in list cache that backs the current page, starting at 0. This is the same as the selection index if not in page mode.
    • getSelectedItem

      public T getSelectedItem()
      Returns currently selected item in list.
    • getStartMasterIndex

      public int getStartMasterIndex()
      Returns index of first item in current page relative to master list that backs it (which starts at index 0). This is -1 if there are no entries, or 0 if not in page mode.