|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.render.Renderer org.apache.shale.usecases.rolodex.WebPagerRenderer
public class WebPagerRenderer
Constructor Summary | |
---|---|
WebPagerRenderer()
|
Method Summary | |
---|---|
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent pager)
This basic component doesn't use javascript for navigation. |
void |
encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent uicomponent)
Delegates to the super implementation. |
void |
encodeEnd(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent pager)
Locates a parent UIData component, decodes the selected page query parameter and advances the first row of the UIData component based on the selected page. |
protected javax.faces.component.UIData |
findDataComponent(javax.faces.component.UIComponent uicomponent)
Looks for the first data component parent. |
protected String |
getActionStr(javax.faces.context.FacesContext context)
Determines the base URL by calling on the view handler. |
protected int |
getCurrentPage(javax.faces.component.UIData uidata)
Returns the current page based on the UIData component's state. |
protected int |
getPageEndIndex(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the ending row index displayed by the UIData component. |
protected int |
getPageEndIndex(int page,
javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the ending row index displayed by the UIData component. |
protected int |
getPageIndex(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the selected page index. |
protected int |
getPages(javax.faces.component.UIData data)
Returns the total number of pages based on the size of the model's set and the total rows displayed. |
protected int |
getPageStartIndex(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the starting row within the UIData's model based on the selected page index, the total rows the model has and the rows per page. |
protected int |
getPageStartIndex(int page,
javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the starting row within the UIData's model based on the selected page index, the total rows the model has and the rows per page. |
protected String |
getPageTag(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the query parameter tag based on the parent UIData component. |
protected int |
getRowsOnPage(int page,
javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns the total rows on the selected page. |
protected int |
getRowsPerPage(javax.faces.component.UIData data)
Returns the rows per page of the UIData component. |
protected Iterator |
iterator(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns a PageInfo Iterator used to render the individual page links. |
protected org.apache.shale.usecases.rolodex.WebPagerRenderer.PageInfo |
nextPage(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns PageInfo that defines the next link. |
protected org.apache.shale.usecases.rolodex.WebPagerRenderer.PageInfo |
prevPage(javax.faces.context.FacesContext context,
javax.faces.component.UIData data)
Returns PageInfo used to render the previous page links. |
protected void |
writeNextPageLink(javax.faces.context.FacesContext context,
javax.faces.component.UIData data,
javax.faces.component.UIComponent pager)
Generates the next page link. |
protected void |
writePageCaption(javax.faces.context.FacesContext context,
javax.faces.component.UIData data,
javax.faces.component.UIComponent pager)
Writes a pager caption documenting the total model rows, current page and total pages. |
protected void |
writePageIndex(javax.faces.context.FacesContext context,
javax.faces.component.UIData data,
javax.faces.component.UIComponent pager)
Renders a hidden input field that keeps track of the current page. |
protected void |
writePageLinks(javax.faces.context.FacesContext context,
javax.faces.component.UIData data,
javax.faces.component.UIComponent pager)
The first ten pages are displayed as individual page links. |
protected void |
writePrevPageLink(javax.faces.context.FacesContext context,
javax.faces.component.UIData data,
javax.faces.component.UIComponent pager)
Writes the previous page link. |
Methods inherited from class javax.faces.render.Renderer |
---|
convertClientId, encodeChildren, getConvertedValue, getRendersChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebPagerRenderer()
Method Detail |
---|
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent pager)
This basic component doesn't use javascript for navigation. This means that the decode logic is in the encode/rendering phase.
decode
in class javax.faces.render.Renderer
public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent pager) throws IOException
Locates a parent UIData component, decodes the selected page query parameter and advances the first row of the UIData component based on the selected page.
encodeEnd
in class javax.faces.render.Renderer
IOException
protected void writePrevPageLink(javax.faces.context.FacesContext context, javax.faces.component.UIData data, javax.faces.component.UIComponent pager) throws IOException
Writes the previous page link.
IOException
protected void writePageIndex(javax.faces.context.FacesContext context, javax.faces.component.UIData data, javax.faces.component.UIComponent pager) throws IOException
Renders a hidden input field that keeps track of the current page.
IOException
protected void writePageCaption(javax.faces.context.FacesContext context, javax.faces.component.UIData data, javax.faces.component.UIComponent pager) throws IOException
Writes a pager caption documenting the total model rows, current page and total pages.
IOException
protected void writePageLinks(javax.faces.context.FacesContext context, javax.faces.component.UIData data, javax.faces.component.UIComponent pager) throws IOException
The first ten pages are displayed as individual page links. The remainder of page links are displayed in increments of ten.
IOException
protected void writeNextPageLink(javax.faces.context.FacesContext context, javax.faces.component.UIData data, javax.faces.component.UIComponent pager) throws IOException
Generates the next page link.
IOException
protected String getActionStr(javax.faces.context.FacesContext context)
Determines the base URL by calling on the view handler.
protected String getPageTag(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the query parameter tag based on the parent UIData component.
protected int getPageIndex(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the selected page index. This would be done in the decode method if this control was not scriptless.
protected int getCurrentPage(javax.faces.component.UIData uidata)
Returns the current page based on the UIData component's state.
protected javax.faces.component.UIData findDataComponent(javax.faces.component.UIComponent uicomponent)
Looks for the first data component parent.
protected int getRowsPerPage(javax.faces.component.UIData data)
Returns the rows per page of the UIData component. The value must be five or more.
protected int getPageStartIndex(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the starting row within the UIData's model based on the selected page index, the total rows the model has and the rows per page.
protected int getPageStartIndex(int page, javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the starting row within the UIData's model based on the selected page index, the total rows the model has and the rows per page.
protected int getPageEndIndex(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the ending row index displayed by the UIData component.
protected int getPageEndIndex(int page, javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the ending row index displayed by the UIData component.
protected int getRowsOnPage(int page, javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns the total rows on the selected page.
protected int getPages(javax.faces.component.UIData data)
Returns the total number of pages based on the size of the model's set and the total rows displayed.
protected org.apache.shale.usecases.rolodex.WebPagerRenderer.PageInfo prevPage(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns PageInfo used to render the previous page links.
protected Iterator iterator(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns a PageInfo Iterator used to render the individual page links.
protected org.apache.shale.usecases.rolodex.WebPagerRenderer.PageInfo nextPage(javax.faces.context.FacesContext context, javax.faces.component.UIData data)
Returns PageInfo that defines the next link.
public void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent uicomponent) throws IOException
Delegates to the super implementation.
encodeBegin
in class javax.faces.render.Renderer
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |