Class FormattedListDisplay<T>
java.lang.Object
name.matthewgreet.strutscommons.view.FormattedListDisplay<T>
Model bean, passed to JSP, that stores list and index of currently, selected item.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns index of last item in current page relative to master list that backs it (which starts at index 0).boolean
Returns whether there is a currently selected item.getList()
Returns list for display, which may be a page if in page mode.int
Returns size of list.int
getPage()
Returns current page number, starting at 1.int
Returns index of last item in current page of list (which starts at index 0).boolean
Whether list should be displayed in pages.int
Returns size of pages.int
Returns index of first item in current page of list (which starts at index 0).int
Returns index of currently selected item relative to current page, stating at 0.Returns currently selected item in list.int
Returns index of currently selected item in list cache that backs the current page, starting at 0.int
Returns index of first item in current page relative to master list that backs it (which starts at index 0).int
Returns total number of items.int
Returns total number of pages.void
void
setPage
(int value) void
setPageMode
(boolean value) void
setPageSize
(int value) void
setSelectedIndex
(int value) void
setTotalItems
(int totalItems) void
setTotalPages
(int value)
-
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
Returns list for display, which may be a page if in page mode. -
setList
-
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
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.
-