org.apache.myfaces.custom.datascroller
Class AbstractHtmlDataScroller

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIPanel
              extended by org.apache.myfaces.custom.datascroller.AbstractHtmlDataScroller
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.StateHolder, DisplayValueOnlyAware, ForceIdAware, StyleAware, UniversalProperties, UserRoleAware, DisplayValueOnlyCapable
Direct Known Subclasses:
HtmlDataScroller

public abstract class AbstractHtmlDataScroller
extends javax.faces.component.UIPanel
implements javax.faces.component.ActionSource, UserRoleAware, DisplayValueOnlyCapable, DisplayValueOnlyAware, ForceIdAware, UniversalProperties, StyleAware

Scroller for UIData components eg. dataTable Must be nested inside footer facet of dataTable OR for attribute must be given so that corresponding uiData can be found. Unless otherwise specified, all attributes accept static values or EL expressions. A component which works together with a UIData component to allow a user to view a large list of data one "page" at a time, and navigate between pages.

Since:
1.1.7
Version:
$Revision: 955086 $ $Date: 2010-06-15 18:32:00 -0500 (Tue, 15 Jun 2010) $
Author:
Thomas Spiegl (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String FACET_FAST_FORWARD
           
static java.lang.String FACET_FAST_REWIND
           
static java.lang.String FACET_FIRST
           
static java.lang.String FACET_LAST
           
static java.lang.String FACET_NEXT
           
static java.lang.String FACET_PREVIOUS
           
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Fields inherited from interface org.apache.myfaces.shared_tomahawk.component.DisplayValueOnlyCapable
DISPLAY_VALUE_ONLY_ATTR, DISPLAY_VALUE_ONLY_STYLE_ATTR, DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR
 
Constructor Summary
AbstractHtmlDataScroller()
           
 
Method Summary
 void addActionListener(javax.faces.event.ActionListener listener)
           
 void broadcast(javax.faces.event.FacesEvent event)
          Invoke any action listeners attached to this class.
protected  void broadcastToActionListener(ScrollerActionEvent event)
           
protected  javax.faces.component.UIData findUIData()
          Find the UIData component associated with this scroller.
 javax.faces.el.MethodBinding getAction()
           
 javax.faces.el.MethodBinding getActionListener()
          MethodBinding pointing at method acception an ActionEvent with return type void.
 javax.faces.event.ActionListener[] getActionListeners()
           
 java.lang.String getClientId(javax.faces.context.FacesContext context)
           
abstract  int getColspan()
          standard html colspan attribute for table cell
abstract  java.lang.String getDisplayedRowsCountVar()
          A parameter name, under which the actual displayed rows count is set in request scope similar to the var parameter.
 javax.faces.component.UIComponent getFastForward()
           
abstract  java.lang.String getFastfStyleClass()
          style-class for data-scroller fast-forward-element
 javax.faces.component.UIComponent getFastRewind()
           
abstract  java.lang.String getFastrStyleClass()
          style-class for data-scroller fast-rewind-element
abstract  int getFastStep()
          step (pages) used for fastforward and fastrewind
 javax.faces.component.UIComponent getFirst()
           
 int getFirstRow()
           
abstract  java.lang.String getFirstRowIndexVar()
          A parameter name, under which the actual first displayed row index is set in request scope similar to the var parameter.
abstract  java.lang.String getFirstStyleClass()
          style-class for data-scroller first-element
abstract  java.lang.String getFor()
          The JSF id of a UIData component that this scroller will affect.
 javax.faces.component.UIComponent getLast()
           
abstract  java.lang.String getLastRowIndexVar()
          A parameter name, under which the actual last displayed row index is set in request scope similar to the var parameter.
abstract  java.lang.String getLastStyleClass()
          style-class for data-scroller last-element
abstract  java.lang.String getLayout()
          The layout this scroller should render with.
 javax.faces.component.UIComponent getNext()
           
abstract  java.lang.String getNextStyleClass()
          style-class for dataScroller next-element
abstract  java.lang.String getOnclick()
          HTML: Script to be invoked when the element is clicked.
abstract  java.lang.String getOndblclick()
          HTML: Script to be invoked when the element is double-clicked.
 int getPageCount()
           
abstract  java.lang.String getPageCountVar()
          A parameter name, under which the actual page count is set in request scope similar to the var parameter.
 int getPageIndex()
           
abstract  java.lang.String getPageIndexVar()
          A parameter name, under which the actual page index is set in request scope similar to the var parameter.
abstract  java.lang.String getPaginatorActiveColumnClass()
          styleClass for paginator's column with pageIndex = currentPageIndex
abstract  java.lang.String getPaginatorActiveColumnStyle()
          style for paginator's column with pageIndex = currentPageIndex
abstract  java.lang.String getPaginatorColumnClass()
          styleClass for paginator's column
abstract  java.lang.String getPaginatorColumnStyle()
          style for paginator's column
abstract  int getPaginatorMaxPages()
          The maximum amount of pages to be displayed in the paginator.
abstract  java.lang.String getPaginatorTableClass()
          styleclass for pagingator
abstract  java.lang.String getPaginatorTableStyle()
          style for pagingator
 javax.faces.component.UIComponent getPrevious()
           
abstract  java.lang.String getPreviousStyleClass()
          style-class for data-scroller previous-element
 boolean getRendersChildren()
           
 int getRowCount()
           
 int getRows()
           
abstract  java.lang.String getRowsCountVar()
          A parameter name, under which the actual rows count is set in request scope similar to the var parameter.
 javax.faces.component.UIData getUIData()
           
abstract  boolean isDisableFacetLinksIfFirstPage()
          If the dataScroller is on the first page (index is at 1), links for first, prev and fastprev are disabled.
abstract  boolean isDisableFacetLinksIfLastPage()
          If the dataScroller is on the last page (index is at pagecount), links for last, next and fastnext are disabled.
 boolean isDisplayValueOnly()
           
abstract  boolean isImmediate()
          True means that the default ActionListener should be executed immediately (i.e.
 boolean isListLayout()
           
abstract  boolean isPaginator()
          If set true, then the paginator gets rendered
abstract  boolean isPaginatorRenderLinkForActive()
          'true' - render a link for the paginator's column with pageIndex = currentPageIndex.
 boolean isRendered()
           
abstract  boolean isRenderFacetLinksIfFirstPage()
          If the dataScroller is on the first page (index is at 1), links for first, prev and fastprev are rendered.
abstract  boolean isRenderFacetLinksIfLastPage()
          If the dataScroller is on the last page (index is at pagecount), links for last, next and fastnext are rendered.
abstract  boolean isRenderFacetsIfSinglePage()
          If set to false, the facets aren't renderd if all the lines are contained on a single page.
 boolean isSetDisplayValueOnly()
           
 boolean isSingleElementLayout()
           
 void queueEvent(javax.faces.event.FacesEvent event)
          Catch any attempts to queue events for this component, and ensure the event's phase is set appropriately.
 void removeActionListener(javax.faces.event.ActionListener listener)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAction(javax.faces.el.MethodBinding action)
           
 void setActionListener(javax.faces.el.MethodBinding actionListener)
           
 void setDisplayValueOnly(boolean displayValueOnly)
           
 void setFastForward(javax.faces.component.UIComponent previous)
           
 void setFastRewind(javax.faces.component.UIComponent previous)
           
 void setFirst(javax.faces.component.UIComponent first)
           
protected  void setFirst(javax.faces.component.UIData uiData, int value)
           
 void setLast(javax.faces.component.UIComponent last)
           
 void setNext(javax.faces.component.UIComponent next)
           
 void setPrevious(javax.faces.component.UIComponent previous)
           
 
Methods inherited from class javax.faces.component.UIPanel
getFamily
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ActionSource
setImmediate
 
Methods inherited from interface org.apache.myfaces.component.UserRoleAware
getEnabledOnUserRole, getVisibleOnUserRole, setEnabledOnUserRole, setVisibleOnUserRole
 
Methods inherited from interface org.apache.myfaces.shared_tomahawk.component.DisplayValueOnlyCapable
getDisplayValueOnlyStyle, getDisplayValueOnlyStyleClass, setDisplayValueOnlyStyle, setDisplayValueOnlyStyleClass
 
Methods inherited from interface org.apache.myfaces.component.DisplayValueOnlyAware
getDisplayValueOnly, getDisplayValueOnlyStyle, getDisplayValueOnlyStyleClass, setDisplayValueOnly, setDisplayValueOnlyStyle, setDisplayValueOnlyStyleClass
 
Methods inherited from interface org.apache.myfaces.component.ForceIdAware
isForceId, isForceIdIndex, setForceId, setForceIdIndex
 
Methods inherited from interface org.apache.myfaces.component.UniversalProperties
getDir, getLang, getTitle
 
Methods inherited from interface org.apache.myfaces.component.StyleAware
getStyle, getStyleClass
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

FACET_FIRST

public static final java.lang.String FACET_FIRST

FACET_PREVIOUS

public static final java.lang.String FACET_PREVIOUS

FACET_NEXT

public static final java.lang.String FACET_NEXT

FACET_LAST

public static final java.lang.String FACET_LAST

FACET_FAST_FORWARD

public static final java.lang.String FACET_FAST_FORWARD

FACET_FAST_REWIND

public static final java.lang.String FACET_FAST_REWIND
Constructor Detail

AbstractHtmlDataScroller

public AbstractHtmlDataScroller()
Method Detail

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Overrides:
getClientId in class javax.faces.component.UIComponentBase

isRendered

public boolean isRendered()
Overrides:
isRendered in class javax.faces.component.UIComponentBase

isSetDisplayValueOnly

public boolean isSetDisplayValueOnly()
Specified by:
isSetDisplayValueOnly in interface DisplayValueOnlyCapable

isDisplayValueOnly

public boolean isDisplayValueOnly()
Specified by:
isDisplayValueOnly in interface DisplayValueOnlyCapable

setDisplayValueOnly

public void setDisplayValueOnly(boolean displayValueOnly)
Specified by:
setDisplayValueOnly in interface DisplayValueOnlyCapable

getLayout

public abstract java.lang.String getLayout()
The layout this scroller should render with. Default is 'table', 'list' is implemented as well. Additionally you can use 'singleList' - then the data-scroller will render a list, but not the paginator - same with the value 'singleTable'.


getColspan

public abstract int getColspan()
standard html colspan attribute for table cell


getOnclick

public abstract java.lang.String getOnclick()
HTML: Script to be invoked when the element is clicked.


getOndblclick

public abstract java.lang.String getOndblclick()
HTML: Script to be invoked when the element is double-clicked.


isListLayout

public boolean isListLayout()

isSingleElementLayout

public boolean isSingleElementLayout()

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Catch any attempts to queue events for this component, and ensure the event's phase is set appropriately. Events are expected to be queued by this component's renderer.

When this component is marked "immediate", any ActionEvent will be marked to fire in the "apply request values" phase. When this component is not immediate the event will fire during the "invoke application" phase instead.

Overrides:
queueEvent in class javax.faces.component.UIComponentBase

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Invoke any action listeners attached to this class.

After listener invocation, the associated UIData's properties get updated:

Overrides:
broadcast in class javax.faces.component.UIComponentBase
Throws:
javax.faces.event.AbortProcessingException

setFirst

protected void setFirst(javax.faces.component.UIData uiData,
                        int value)

broadcastToActionListener

protected void broadcastToActionListener(ScrollerActionEvent event)
Parameters:
event -

getUIData

public javax.faces.component.UIData getUIData()
Returns:
int

getPageIndex

public int getPageIndex()
Returns:
the page index of the uidata

getPageCount

public int getPageCount()
Returns:
the page count of the uidata

getRowCount

public int getRowCount()
Returns:
int

getRows

public int getRows()
Returns:
int

getFirstRow

public int getFirstRow()
Returns:
int

findUIData

protected javax.faces.component.UIData findUIData()
Find the UIData component associated with this scroller.

If the "for" attribute is not null then that value is used to find the specified component by id. Both "relative" and "absolute" ids are allowed; see method UIComponent.findComponent for details.

If the "for" attribute is not defined, then this component is expected to be a child of a UIData component.

Throws:
java.lang.IllegalArgumentException - if an associated UIData component cannot be found.

setFirst

public void setFirst(javax.faces.component.UIComponent first)

getFirst

public javax.faces.component.UIComponent getFirst()

setLast

public void setLast(javax.faces.component.UIComponent last)

getLast

public javax.faces.component.UIComponent getLast()

setNext

public void setNext(javax.faces.component.UIComponent next)

getNext

public javax.faces.component.UIComponent getNext()

setFastForward

public void setFastForward(javax.faces.component.UIComponent previous)

getFastForward

public javax.faces.component.UIComponent getFastForward()

setFastRewind

public void setFastRewind(javax.faces.component.UIComponent previous)

getFastRewind

public javax.faces.component.UIComponent getFastRewind()

setPrevious

public void setPrevious(javax.faces.component.UIComponent previous)

getPrevious

public javax.faces.component.UIComponent getPrevious()

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase

getAction

public javax.faces.el.MethodBinding getAction()
Specified by:
getAction in interface javax.faces.component.ActionSource
See Also:
ActionSource.getAction()

setAction

public void setAction(javax.faces.el.MethodBinding action)
Specified by:
setAction in interface javax.faces.component.ActionSource
See Also:
ActionSource.setAction(javax.faces.el.MethodBinding)

setActionListener

public void setActionListener(javax.faces.el.MethodBinding actionListener)
Specified by:
setActionListener in interface javax.faces.component.ActionSource
See Also:
ActionSource.setActionListener(javax.faces.el.MethodBinding)

getActionListener

public javax.faces.el.MethodBinding getActionListener()
MethodBinding pointing at method acception an ActionEvent with return type void.

Specified by:
getActionListener in interface javax.faces.component.ActionSource
See Also:
ActionSource.getActionListener()

addActionListener

public void addActionListener(javax.faces.event.ActionListener listener)
Specified by:
addActionListener in interface javax.faces.component.ActionSource
See Also:
ActionSource.addActionListener(javax.faces.event.ActionListener)

getActionListeners

public javax.faces.event.ActionListener[] getActionListeners()
Specified by:
getActionListeners in interface javax.faces.component.ActionSource
See Also:
ActionSource.getActionListeners()

removeActionListener

public void removeActionListener(javax.faces.event.ActionListener listener)
Specified by:
removeActionListener in interface javax.faces.component.ActionSource
See Also:
ActionSource.removeActionListener(javax.faces.event.ActionListener)

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

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

getFor

public abstract java.lang.String getFor()
The JSF id of a UIData component that this scroller will affect. If this attribute is not present then the datascroller must be a child of a UIData component.


getFastStep

public abstract int getFastStep()
step (pages) used for fastforward and fastrewind


getPageIndexVar

public abstract java.lang.String getPageIndexVar()
A parameter name, under which the actual page index is set in request scope similar to the var parameter.


getPageCountVar

public abstract java.lang.String getPageCountVar()
A parameter name, under which the actual page count is set in request scope similar to the var parameter.


getRowsCountVar

public abstract java.lang.String getRowsCountVar()
A parameter name, under which the actual rows count is set in request scope similar to the var parameter.


getDisplayedRowsCountVar

public abstract java.lang.String getDisplayedRowsCountVar()
A parameter name, under which the actual displayed rows count is set in request scope similar to the var parameter.


getFirstRowIndexVar

public abstract java.lang.String getFirstRowIndexVar()
A parameter name, under which the actual first displayed row index is set in request scope similar to the var parameter.


getLastRowIndexVar

public abstract java.lang.String getLastRowIndexVar()
A parameter name, under which the actual last displayed row index is set in request scope similar to the var parameter.


isPaginator

public abstract boolean isPaginator()
If set true, then the paginator gets rendered


getPaginatorMaxPages

public abstract int getPaginatorMaxPages()
The maximum amount of pages to be displayed in the paginator.


getPaginatorTableClass

public abstract java.lang.String getPaginatorTableClass()
styleclass for pagingator


getPaginatorTableStyle

public abstract java.lang.String getPaginatorTableStyle()
style for pagingator


getPaginatorColumnClass

public abstract java.lang.String getPaginatorColumnClass()
styleClass for paginator's column


getPaginatorColumnStyle

public abstract java.lang.String getPaginatorColumnStyle()
style for paginator's column


getPaginatorActiveColumnClass

public abstract java.lang.String getPaginatorActiveColumnClass()
styleClass for paginator's column with pageIndex = currentPageIndex


isPaginatorRenderLinkForActive

public abstract boolean isPaginatorRenderLinkForActive()
'true' - render a link for the paginator's column with pageIndex = currentPageIndex. Default-value is 'true'.


getFirstStyleClass

public abstract java.lang.String getFirstStyleClass()
style-class for data-scroller first-element


getLastStyleClass

public abstract java.lang.String getLastStyleClass()
style-class for data-scroller last-element


getPreviousStyleClass

public abstract java.lang.String getPreviousStyleClass()
style-class for data-scroller previous-element


getNextStyleClass

public abstract java.lang.String getNextStyleClass()
style-class for dataScroller next-element


getFastfStyleClass

public abstract java.lang.String getFastfStyleClass()
style-class for data-scroller fast-forward-element


getFastrStyleClass

public abstract java.lang.String getFastrStyleClass()
style-class for data-scroller fast-rewind-element


getPaginatorActiveColumnStyle

public abstract java.lang.String getPaginatorActiveColumnStyle()
style for paginator's column with pageIndex = currentPageIndex


isRenderFacetsIfSinglePage

public abstract boolean isRenderFacetsIfSinglePage()
If set to false, the facets aren't renderd if all the lines are contained on a single page. Default is true.


isImmediate

public abstract boolean isImmediate()
True means that the default ActionListener should be executed immediately (i.e. during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase.

Specified by:
isImmediate in interface javax.faces.component.ActionSource

isDisableFacetLinksIfFirstPage

public abstract boolean isDisableFacetLinksIfFirstPage()
If the dataScroller is on the first page (index is at 1), links for first, prev and fastprev are disabled. Default is false.


isDisableFacetLinksIfLastPage

public abstract boolean isDisableFacetLinksIfLastPage()
If the dataScroller is on the last page (index is at pagecount), links for last, next and fastnext are disabled. Default is false.


isRenderFacetLinksIfFirstPage

public abstract boolean isRenderFacetLinksIfFirstPage()
If the dataScroller is on the first page (index is at 1), links for first, prev and fastprev are rendered. Default is true.


isRenderFacetLinksIfLastPage

public abstract boolean isRenderFacetLinksIfLastPage()
If the dataScroller is on the last page (index is at pagecount), links for last, next and fastnext are rendered. Default is true.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.