org.alfresco.web.ui.common.component.data
Class UIRichList

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.alfresco.web.ui.common.component.data.UIRichList
All Implemented Interfaces:
java.io.Serializable, javax.faces.component.StateHolder, IDataContainer
Direct Known Subclasses:
UIAVMList

public class UIRichList
extends javax.faces.component.UIComponentBase
implements IDataContainer, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.util.Map viewRenderers
          map of available IRichListRenderer instances
 
Fields inherited from interface org.alfresco.web.data.IDataContainer
SORT_CASEINSENSITIVE, SORT_CASESENSITIVE
 
Constructor Summary
UIRichList()
          Default constructor
 
Method Summary
 void bind()
          Method called to bind the RichList component state to the data model value
 void clearSort()
          Clear the current sorting settings back to the defaults
 int getCurrentPage()
          Return the current page the list is displaying
 java.lang.String getCurrentSortColumn()
          Return the currently sorted column if any
 javax.faces.component.UIComponent getEmptyMessage()
          Return the UI Component to be used as the "no items available" message
 java.lang.String getFamily()
           
 java.lang.String getInitialSortColumn()
           
 int getPageCount()
          Return the count of max available pages
 int getPageSize()
          Returns the current page size used for this list, or -1 for no paging.
 boolean getRefreshOnBind()
          Get the refreshOnBind flag.
 java.lang.Object getValue()
          Get the value (for this component the value is an object used as the DataModel)
 java.lang.String getViewMode()
          Get the view mode for this Rich List
 IRichListRenderer getViewRenderer()
           
 boolean isCurrentSortDescending()
          Returns the current sort direction.
 boolean isDataAvailable()
          Returns true if a row of data is available
 boolean isInitialSortDescending()
           
 java.lang.Object nextRow()
          Returns the next row of data from the data model
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setCurrentPage(int index)
          Set the current page to display.
 void setInitialSortColumn(java.lang.String initialSortColumn)
           
 void setInitialSortDescending(boolean initialSortDescending)
           
 void setPageSize(int val)
          Sets the current page size used for the list.
 void setRefreshOnBind(boolean refreshOnBind)
          Set the refreshOnBind flag.
 void setValue(java.lang.Object value)
          Set the value (for this component the value is an object used as the DataModel)
 void setViewMode(java.lang.String viewMode)
          Set the current view mode for this Rich List
 void sort(java.lang.String column, boolean descending, java.lang.String mode)
          Sort the dataset using the specified sort parameters
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewRenderers

protected final java.util.Map viewRenderers
map of available IRichListRenderer instances

Constructor Detail

UIRichList

public UIRichList()
Default constructor

Method Detail

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent
See Also:
UIComponent.getFamily()

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase
See Also:
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase
See Also:
StateHolder.saveState(javax.faces.context.FacesContext)

getValue

public java.lang.Object getValue()
Get the value (for this component the value is an object used as the DataModel)

Returns:
the value

setValue

public void setValue(java.lang.Object value)
Set the value (for this component the value is an object used as the DataModel)

Parameters:
value - the value

clearSort

public void clearSort()
Clear the current sorting settings back to the defaults


getViewMode

public java.lang.String getViewMode()
Get the view mode for this Rich List

Returns:
view mode as a String

setViewMode

public void setViewMode(java.lang.String viewMode)
Set the current view mode for this Rich List

Parameters:
viewMode - the view mode as a String

getRefreshOnBind

public boolean getRefreshOnBind()
Get the refreshOnBind flag.

Returns:
the refreshOnBind

setRefreshOnBind

public void setRefreshOnBind(boolean refreshOnBind)
Set the refreshOnBind flag. True to force the list to retrieve bound data on bind().

Parameters:
refreshOnBind - the refreshOnBind

getEmptyMessage

public javax.faces.component.UIComponent getEmptyMessage()
Return the UI Component to be used as the "no items available" message

Returns:
UIComponent

getCurrentSortColumn

public java.lang.String getCurrentSortColumn()
Return the currently sorted column if any

Specified by:
getCurrentSortColumn in interface IDataContainer
Returns:
current sorted column if any

isCurrentSortDescending

public boolean isCurrentSortDescending()
Description copied from interface: IDataContainer
Returns the current sort direction. Only valid if a sort column is set. True is returned for descending sort, false for accending sort.

Specified by:
isCurrentSortDescending in interface IDataContainer
Returns:
true for descending sort, false for accending sort
See Also:
IDataContainer.isCurrentSortDescending()

getInitialSortColumn

public java.lang.String getInitialSortColumn()
Returns:
Returns the initialSortColumn.

setInitialSortColumn

public void setInitialSortColumn(java.lang.String initialSortColumn)
Parameters:
initialSortColumn - The initialSortColumn to set.

isInitialSortDescending

public boolean isInitialSortDescending()
Returns:
Returns the initialSortDescending.

setInitialSortDescending

public void setInitialSortDescending(boolean initialSortDescending)
Parameters:
initialSortDescending - The initialSortDescending to set.

getPageSize

public int getPageSize()
Returns the current page size used for this list, or -1 for no paging.

Specified by:
getPageSize in interface IDataContainer

setPageSize

public void setPageSize(int val)
Sets the current page size used for the list.

Parameters:
val -

getPageCount

public int getPageCount()
Description copied from interface: IDataContainer
Return the count of max available pages

Specified by:
getPageCount in interface IDataContainer
Returns:
count of max available pages
See Also:
IDataContainer.getPageCount()

getCurrentPage

public int getCurrentPage()
Return the current page the list is displaying

Specified by:
getCurrentPage in interface IDataContainer
Returns:
current page zero based index

setCurrentPage

public void setCurrentPage(int index)
Description copied from interface: IDataContainer
Set the current page to display.

Specified by:
setCurrentPage in interface IDataContainer
Parameters:
index - Zero based page index to display
See Also:
IDataContainer.setCurrentPage(int)

isDataAvailable

public boolean isDataAvailable()
Returns true if a row of data is available

Specified by:
isDataAvailable in interface IDataContainer
Returns:
true if data is available, false otherwise

nextRow

public java.lang.Object nextRow()
Returns the next row of data from the data model

Specified by:
nextRow in interface IDataContainer
Returns:
next row of data as a Bean object

sort

public void sort(java.lang.String column,
                 boolean descending,
                 java.lang.String mode)
Sort the dataset using the specified sort parameters

Specified by:
sort in interface IDataContainer
Parameters:
column - Column to sort
descending - True for descending sort, false for ascending
mode - Sort mode to use (see IDataContainer constants)

bind

public void bind()
Method called to bind the RichList component state to the data model value


getViewRenderer

public IRichListRenderer getViewRenderer()
Returns:
A new IRichListRenderer implementation for the current view mode


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.