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 TypeMethodDescriptionbooleanReturns whether there is a currently selected item.intReturns index of currently selected item relative to current page, stating at 0.getList()Returns list for display, which may be a page if in page mode.intReturns size of list.intgetPage()Returns current page number, starting at 1.intReturns index of last item in current page relative to master list that backs it (which starts at index 0).booleanWhether list should be displayed in pages.intReturns size of pages.intReturns index of first item in current page relative to master list that backs it (which starts at index 0).intReturns index of currently selected item in list cache that backs the current page, starting at 0.Returns currently selected item in list.intReturns total number of items.intReturns total number of pages.voidsetInPageIndex(int value) voidvoidsetPage(int value) voidsetPageMode(boolean value) voidsetPageSize(int value) voidsetTotalItems(int totalItems) voidsetTotalPages(int value)
-
Constructor Details
-
FormattedListDisplay
public FormattedListDisplay()Default constructor.
-
-
Method Details
-
getHasSelectedItem
public boolean getHasSelectedItem()Returns whether there is a currently selected item. -
getInPageIndex
public int getInPageIndex()Returns index of currently selected item relative to current page, stating at 0. -
setInPageIndex
public void setInPageIndex(int value) -
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) -
getPageEndSelectedIndex
public int getPageEndSelectedIndex()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. -
getPageSize
public int getPageSize()Returns size of pages. Only useful if in page mode. -
setPageSize
public void setPageSize(int value) -
getPageStartSelectedIndex
public int getPageStartSelectedIndex()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. -
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 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.
-