public class CmsHtmlList
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
ICON_LEFT
Standard list button location.
|
static java.lang.String |
ICON_RIGHT
Standard list button location.
|
static java.lang.String |
ITEM_SEPARATOR
Constant for item separator char used for coding/encoding multiselection.
|
protected int |
m_currentPage
Current displayed page number.
|
protected CmsListOrderEnum |
m_currentSortOrder
Current sort order.
|
protected java.util.List<CmsListItem> |
m_filteredItems
Filtered list of items or
null if no filter is set and not sorted. |
protected java.lang.String |
m_id
Dhtml id.
|
protected boolean |
m_isBoxed
If this flag is set the list will be surrounded by a box.
|
protected int |
m_maxItemsPerPage
Maximum number of items per page.
|
protected CmsListMetadata |
m_metadata
Metadata for building the list.
|
protected CmsMessageContainer |
m_name
Display Name of the list.
|
protected java.util.List<CmsListItem> |
m_originalItems
Really content of the list.
|
protected boolean |
m_printable
printable flag.
|
protected java.lang.String |
m_searchFilter
Search filter text.
|
protected boolean |
m_showTitle
Show the title of the list.
|
protected int |
m_size
The filtered content size, only used if data self managed.
|
protected java.lang.String |
m_sortedColumn
Column name to be sorted.
|
protected int |
m_totalSize
The total size, only used is data self managed.
|
protected java.util.List<CmsListItem> |
m_visibleItems
Items currently displayed.
|
protected A_CmsListDialog |
m_wp
The related workplace dialog object.
|
static java.lang.String |
NO_SELECTION_HELP_VAR
Constant name for error message if no item has been selected.
|
static java.lang.String |
NO_SELECTION_MATCH_HELP_VAR
Constant name for error message if number of selected items does not match.
|
构造器和说明 |
---|
CmsHtmlList(java.lang.String id,
CmsMessageContainer name,
CmsListMetadata metadata)
Default Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
clear()
This method resets the content of the list (no the metadata).
|
protected int |
displayedFrom()
Returns the number (from 1) of the first displayed item.
|
protected int |
displayedTo()
Returns the number (from 1) of the last displayed item.
|
java.util.List<CmsListItem> |
getAllContent()
Returns all list items in the list, may be not visible and sorted.
|
java.util.List<CmsListItem> |
getContent()
Returns the filtered list of list items.
|
int |
getCurrentPage()
returns the number of the current page.
|
java.util.List<CmsListItem> |
getCurrentPageItems()
Returns all items of the current page.
|
CmsListOrderEnum |
getCurrentSortOrder()
Returns the current used sort order.
|
java.lang.String |
getId()
Returns the id.
|
CmsListItem |
getItem(java.lang.String id)
This method returns the item identified by the parameter id.
|
int |
getMaxItemsPerPage()
Returns the maximum number of items per page.
|
CmsListMetadata |
getMetadata()
Returns the metadata.
|
CmsMessageContainer |
getName()
Returns the name of the list.
|
int |
getNumberOfPages()
Returns the filtered number of pages.
|
java.lang.String |
getSearchFilter()
Returns the search filter.
|
int |
getSize()
Return the filtered number of items.
|
java.lang.String |
getSortedColumn()
Returns the sorted column's name.
|
CmsListState |
getState()
Returns a filled list state.
|
int |
getTotalNumberOfPages()
Returns the total number of pages.
|
int |
getTotalSize()
Return the total number of items.
|
A_CmsListDialog |
getWp()
Returns the workplace dialog object.
|
protected java.lang.String |
htmlBegin()
Generates the initial html code.
|
protected java.lang.String |
htmlEnd()
Generates the need html code for ending a list.
|
static java.lang.String |
htmlPageSelector(int nrPages,
int itemsPage,
int nrItems,
int curPage,
java.util.Locale locale)
Generates the list of html option elements for a html select control to select a page of a list.
|
protected java.lang.String |
htmlPagingBar()
Generates the needed html code for the paging bar.
|
protected java.lang.String |
htmlTitle()
Returns the html for the title of the list.
|
protected java.lang.String |
htmlToolBar()
Returns the html code for the toolbar (search bar + multiactions bar).
|
boolean |
isBoxed()
Returns the isBoxed flag.
|
boolean |
isPrintable()
Returns the printable flag.
|
boolean |
isShowTitle()
Returns if the list title is shown.
|
java.lang.String |
listCsv()
Generates the csv output for the list.
|
java.lang.String |
listHtml()
Generates the html code for the list.
|
java.lang.String |
listJs()
Generate the need js code for the list.
|
CmsListItem |
newItem(java.lang.String id)
Returns a new list item for this list.
|
java.lang.String |
printableHtml()
Returns html code for printing the list.
|
CmsListItem |
removeItem(java.lang.String id)
Removes an item from the list.
|
void |
setBoxed(boolean isBoxed)
Sets the isBoxed flag.
|
void |
setContent(java.util.Collection<CmsListItem> listItems)
Sets the list item to display in the list.
|
void |
setCurrentPage(int currentPage)
Sets the current page.
|
void |
setMaxItemsPerPage(int maxItemsPerPage)
Sets the maximum number of items per page.
|
protected void |
setMetadata(CmsListMetadata metadata)
Sets the metadata for this list.
|
void |
setName(CmsMessageContainer name)
Sets the name of the list.
|
void |
setSearchFilter(java.lang.String searchFilter)
Sets the search filter.
|
void |
setShowTitle(boolean showTitle)
Sets if the list title is shown.
|
void |
setSize(int size)
Sets the current filtered size, only used if data self managed.
|
void |
setSortedColumn(java.lang.String sortedColumn)
Sets the sorted column.
|
void |
setState(CmsListState listState)
Sets the list state.
|
void |
setTotalSize(int totalSize)
Sets the total Size, only used if data self managed.
|
void |
setWp(A_CmsListDialog wp)
Sets the workplace dialog object.
|
public static final java.lang.String ICON_LEFT
public static final java.lang.String ICON_RIGHT
public static final java.lang.String ITEM_SEPARATOR
public static final java.lang.String NO_SELECTION_HELP_VAR
public static final java.lang.String NO_SELECTION_MATCH_HELP_VAR
protected int m_currentPage
protected CmsListOrderEnum m_currentSortOrder
protected java.util.List<CmsListItem> m_filteredItems
null
if no filter is set and not sorted.protected final java.lang.String m_id
protected boolean m_isBoxed
protected int m_maxItemsPerPage
protected CmsListMetadata m_metadata
protected CmsMessageContainer m_name
protected java.util.List<CmsListItem> m_originalItems
protected boolean m_printable
protected java.lang.String m_searchFilter
protected boolean m_showTitle
protected int m_size
protected java.lang.String m_sortedColumn
protected int m_totalSize
protected java.util.List<CmsListItem> m_visibleItems
protected transient A_CmsListDialog m_wp
public CmsHtmlList(java.lang.String id, CmsMessageContainer name, CmsListMetadata metadata)
id
- unique id of the list, is used as name for controls and js functions and varsname
- the display namemetadata
- the list's metadatapublic static java.lang.String htmlPageSelector(int nrPages, int itemsPage, int nrItems, int curPage, java.util.Locale locale)
nrPages
- the total number of pagesitemsPage
- the maximum number of items per pagenrItems
- the total number of itemscurPage
- the current pagelocale
- the localepublic void clear()
public java.util.List<CmsListItem> getAllContent()
public java.util.List<CmsListItem> getContent()
Equals to
if no filter is set.getAllContent()
public int getCurrentPage()
public java.util.List<CmsListItem> getCurrentPageItems()
CmsListItem
objectspublic CmsListOrderEnum getCurrentSortOrder()
public java.lang.String getId()
public CmsListItem getItem(java.lang.String id)
Only current visible item can be retrieved using this method.
id
- the id of the item to look fornull
if not foundpublic int getMaxItemsPerPage()
public CmsListMetadata getMetadata()
public CmsMessageContainer getName()
public int getNumberOfPages()
Equals to
if no filter is set.getTotalNumberOfPages()
public java.lang.String getSearchFilter()
public int getSize()
Equals to
if no filter is set.getTotalSize()
public java.lang.String getSortedColumn()
public CmsListState getState()
public int getTotalNumberOfPages()
public int getTotalSize()
public A_CmsListDialog getWp()
public boolean isBoxed()
If this flag is set the list will be surrounded by a box.
public boolean isPrintable()
public boolean isShowTitle()
public java.lang.String listCsv()
public java.lang.String listHtml()
public java.lang.String listJs()
public CmsListItem newItem(java.lang.String id)
id
- the id of the item has to be uniquepublic java.lang.String printableHtml()
public CmsListItem removeItem(java.lang.String id)
Keeping care of all the state like sorted column, sorting order, displayed page and search filter.
Try to use it instead of
.A_CmsListDialog.refreshList()
id
- the id of the item to removepublic void setBoxed(boolean isBoxed)
If this flag is set, the list will be surrounded by a box.
isBoxed
- the isBoxed flag to setpublic void setContent(java.util.Collection<CmsListItem> listItems)
listItems
- a collection of CmsListItem
objectspublic void setCurrentPage(int currentPage) throws CmsIllegalArgumentException
currentPage
- the current page to setCmsIllegalArgumentException
- if the argument is invalidpublic void setMaxItemsPerPage(int maxItemsPerPage)
maxItemsPerPage
- the maximum number of items per page to setpublic void setName(CmsMessageContainer name)
name
- the name of the listpublic void setSearchFilter(java.lang.String searchFilter)
searchFilter
- the search filter to setpublic void setShowTitle(boolean showTitle)
showTitle
- true if the list title is shown, otherwise falsepublic void setSize(int size)
size
- the size to setpublic void setSortedColumn(java.lang.String sortedColumn) throws CmsIllegalArgumentException
sortedColumn
- the sorted column to setCmsIllegalArgumentException
- if the sortedColumn
argument is invalidpublic void setState(CmsListState listState)
This may involve sorting, filtering and paging.
listState
- the state to be setpublic void setTotalSize(int totalSize)
totalSize
- the total Size to setpublic void setWp(A_CmsListDialog wp)
wp
- the workplace dialog object to setprotected int displayedFrom()
protected int displayedTo()
protected java.lang.String htmlBegin()
protected java.lang.String htmlEnd()
protected java.lang.String htmlPagingBar()
protected java.lang.String htmlTitle()
protected java.lang.String htmlToolBar()
protected void setMetadata(CmsListMetadata metadata)
Should only be used by the
class
for temporally removing the metadata object while the list is saved in the
A_CmsListDialog
.CmsWorkplaceSettings
metadata
- the list metadata