|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.list.CmsHtmlList
The main class of the html list widget.
Field Summary | |
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. |
static java.lang.String |
NO_SELECTION_HELP_VAR
Var name for error message if no item has been selected. |
static java.lang.String |
NO_SELECTION_MATCH_HELP_VAR
Var name for error message if number of selected items does not match. |
Constructor Summary | |
CmsHtmlList(java.lang.String id,
CmsMessageContainer name,
CmsListMetadata metadata)
Default Constructor. |
Method Summary | |
void |
addAllItems(java.util.Collection listItems)
Adds a collection new list items to the content of the list. |
void |
addItem(CmsListItem listItem)
Adds a new item to the content of the list. |
void |
clear(java.util.Locale locale)
This method resets the content of the list (no the metadata). |
java.util.List |
getAllContent()
Returns all list items in the list, may be not visible and sorted. |
java.util.List |
getContent()
Returns the filtered list of list items. |
int |
getCurrentPage()
returns the number of the current page. |
java.util.List |
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. |
void |
insertAllItems(java.util.Collection listItems,
java.util.Locale locale)
Inserts a collection of list items in an already initialized list. |
void |
insertItem(CmsListItem listItem,
java.util.Locale locale)
Inserts an item in an already initialized list. |
boolean |
isPrintable()
Returns the printable flag. |
java.lang.String |
listCsv(CmsWorkplace wp)
Generates the csv output for the list. |
java.lang.String |
listHtml(CmsWorkplace wp)
Generates the html code for the list. |
java.lang.String |
listJs(java.util.Locale locale)
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(CmsWorkplace wp)
Returns html code for printing the list. |
java.util.List |
removeAllItems(java.util.Collection ids,
java.util.Locale locale)
Removes a collection of list items from the list. |
CmsListItem |
removeItem(java.lang.String id,
java.util.Locale locale)
Removes an item from the list. |
java.util.List |
replaceAllItems(java.util.List listItems,
java.util.Locale locale)
Replace a list of items in the list. |
CmsListItem |
replaceItem(CmsListItem listItem,
java.util.Locale locale)
Replace an item in the list. |
void |
setCurrentPage(int currentPage)
Sets the current page. |
void |
setMaxItemsPerPage(int maxItemsPerPage)
Sets the maximum number of items per page. |
void |
setSearchFilter(java.lang.String searchFilter,
java.util.Locale locale)
Sets the search filter. |
void |
setSortedColumn(java.lang.String sortedColumn,
java.util.Locale locale)
Sets the sorted column. |
void |
setState(CmsListState listState,
java.util.Locale locale)
Sets the list state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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
Constructor Detail |
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 metadataMethod Detail |
public void addAllItems(java.util.Collection listItems)
If you need to add or remove items from or to the list at a later step, use the
or
insertAllItems(Collection, Locale)
methods.removeAllItems(Collection, Locale)
listItems
- the collection of list items to addList.addAll(Collection)
public void addItem(CmsListItem listItem)
If you need to add or remove an item from or to the list at a later step, use the
or
insertItem(CmsListItem, Locale)
methods.removeItem(String, Locale)
listItem
- the list itemList.add(Object)
public void clear(java.util.Locale locale)
locale
- the locale for sorting/searchingpublic java.util.List getAllContent()
public java.util.List getContent()
Equals to
if no filter is set.getAllContent()
public int getCurrentPage()
public java.util.List 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 for
null
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 void insertAllItems(java.util.Collection listItems, java.util.Locale locale)
Keeping care of all the state like sorted column, sorting order, displayed page and search filter.
listItems
- the collection of list items to insertlocale
- the localepublic void insertItem(CmsListItem listItem, java.util.Locale locale)
Keeping care of all the state like sorted column, sorting order, displayed page and search filter.
listItem
- the list item to insertlocale
- the localepublic boolean isPrintable()
public java.lang.String listCsv(CmsWorkplace wp)
Synchronized to not collide with
.listHtml(CmsWorkplace)
wp
- the workplace object
public java.lang.String listHtml(CmsWorkplace wp)
Synchronized to not collide with
.printableHtml(CmsWorkplace)
wp
- the workplace object
public java.lang.String listJs(java.util.Locale locale)
locale
- the locale
public CmsListItem newItem(java.lang.String id)
id
- the id of the item has to be unique
public java.lang.String printableHtml(CmsWorkplace wp)
Synchronized to not collide with
.listHtml(CmsWorkplace)
wp
- the workplace object
public java.util.List removeAllItems(java.util.Collection ids, java.util.Locale locale)
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()
ids
- the collection of ids of the items to removelocale
- the locale
public CmsListItem removeItem(java.lang.String id, java.util.Locale locale)
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 removelocale
- the locale
public java.util.List replaceAllItems(java.util.List listItems, java.util.Locale locale)
Keeping care of all the state like sorted column, sorting order, displayed page and search filter.
If the list already contains an item with the id of a given list item, it will be removed and
replaced by the new list item. if not, this method is the same as the
method.
Try to use it instead of insertAllItems(Collection, Locale)
.A_CmsListDialog.refreshList()
listItems
- the list of CmsListItem
s to replacelocale
- the locale
null
public CmsListItem replaceItem(CmsListItem listItem, java.util.Locale locale)
Keeping care of all the state like sorted column, sorting order, displayed page and search filter.
If the list already contains an item with the id of the given list item, it will be removed and
replaced by the new list item. if not, this method is the same as the
method.
Try to use it instead of insertItem(CmsListItem, Locale)
.A_CmsListDialog.refreshList()
listItem
- the listItem to replacelocale
- the locale
null
public void setCurrentPage(int currentPage) throws CmsIllegalArgumentException
currentPage
- the current page to set
CmsIllegalArgumentException
- if the argument is invalidpublic void setMaxItemsPerPage(int maxItemsPerPage)
maxItemsPerPage
- the maximum number of items per page to setpublic void setSearchFilter(java.lang.String searchFilter, java.util.Locale locale)
searchFilter
- the search filter to setlocale
- the used locale for searching/sortingpublic void setSortedColumn(java.lang.String sortedColumn, java.util.Locale locale) throws CmsIllegalArgumentException
sortedColumn
- the sorted column to setlocale
- the used locale for sorting
CmsIllegalArgumentException
- if the sortedColumn
argument is invalidpublic void setState(CmsListState listState, java.util.Locale locale)
This may involve sorting, filtering and paging.
listState
- the state to be setlocale
- the locale
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |