com.primix.vlib.components
Class Browser

java.lang.Object
  |
  +--com.primix.tapestry.AbstractComponent
        |
        +--com.primix.tapestry.BaseComponent
              |
              +--com.primix.vlib.components.Browser
All Implemented Interfaces:
java.util.EventListener, IComponent, IRender, PageDetachListener

public class Browser
extends BaseComponent
implements PageDetachListener

Implements a paging browser for the results of a IBookQuery.

Version:
$Id: Browser.java,v 1.6 2001/08/28 20:33:41 hship Exp $
Author:
Howard Ship

Field Summary
static int DEFAULT_PAGE_SIZE
          Default for the page size; the number of results viewed on each page.
 
Fields inherited from class com.primix.tapestry.BaseComponent
outer, OUTER_INIT_SIZE, outerCount
 
Fields inherited from class com.primix.tapestry.AbstractComponent
id, page, specification, wrapped, wrappedCount
 
Constructor Summary
Browser()
           
 
Method Summary
protected  void finishLoad()
          Register this component as a PageDetachListener.
 int getCurrentPage()
           
 int getNextPage()
           
 int getPageCount()
           
 Book[] getPageResults()
          Returns a subset of the results from the query corresponding to the current page of results.
 int getPreviousPage()
           
 IBookQuery getQuery()
           
 IBinding getQueryBinding()
           
 java.lang.String getRange()
           
 int getResultCount()
           
 boolean getShowNextLink()
           
 boolean getShowPreviousLink()
           
 void initializeForResultCount(int resultCount)
          Invoked by the container when the query (otherwise accessed via the query parameter) changes.
 void jump(java.lang.String[] context, IRequestCycle cycle)
           
 void pageDetached(PageEvent event)
          Clear out cached values at the end of the request cycle.
 void setCurrentPage(int value)
           
 void setQueryBinding(IBinding value)
           
 void setResultCount(int value)
           
 
Methods inherited from class com.primix.tapestry.BaseComponent
addOuter, finishLoad, readTemplate, render
 
Methods inherited from class com.primix.tapestry.AbstractComponent
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_SIZE

public static final int DEFAULT_PAGE_SIZE
Default for the page size; the number of results viewed on each page.
Constructor Detail

Browser

public Browser()
Method Detail

finishLoad

protected void finishLoad()
Register this component as a PageDetachListener.
Overrides:
finishLoad in class AbstractComponent
Since:
1.0.5

pageDetached

public void pageDetached(PageEvent event)
Clear out cached values at the end of the request cycle.
Specified by:
pageDetached in interface PageDetachListener
Since:
1.0.5

setQueryBinding

public void setQueryBinding(IBinding value)

getQueryBinding

public IBinding getQueryBinding()

getQuery

public IBookQuery getQuery()

getResultCount

public int getResultCount()

setResultCount

public void setResultCount(int value)

getCurrentPage

public int getCurrentPage()

setCurrentPage

public void setCurrentPage(int value)

initializeForResultCount

public void initializeForResultCount(int resultCount)
Invoked by the container when the query (otherwise accessed via the query parameter) changes. Re-caches the number of results and sets the current page back to 1.

getPageCount

public int getPageCount()

getPreviousPage

public int getPreviousPage()

getNextPage

public int getNextPage()

getPageResults

public Book[] getPageResults()
Returns a subset of the results from the query corresponding to the current page of results. This may be null if there are no results. All pages but the last have the same number of results, the final page may be short a few.

jump

public void jump(java.lang.String[] context,
                 IRequestCycle cycle)

getRange

public java.lang.String getRange()

getShowPreviousLink

public boolean getShowPreviousLink()

getShowNextLink

public boolean getShowNextLink()