|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.jato.view.ViewBase | +--com.iplanet.jato.view.ContainerViewBase | +--com.iplanet.jato.view.TiledViewBase
A default implementation of TiledView
. This implementation
provides optimized initialization of child views; child views are not created
unless they are referenced. Furthermore, it provides virtualization of
children per tile--the same child instance is used to represent that child
in each tile.
Changes for TiledView/container fix:
- ensureChild() would need to be overridden to create special children if one
wasn't available for the current row
- We'd need to cache a set of special views based on the max display size &
display index
- We'd need a clearcut way for a special child view to obtain a model instance
that was unique to it (a no sharing option)
- Do we allow the developer to tell us not to virtualize the field, or do we
decide to do this on our own for all container views?
- Do we need an event, like TileChangeEvent, that is propagated down to special
children so that they can perform certain behavior?
Field Summary | |
protected static int |
UNDEFINED_ROW_INDEX
|
Fields inherited from class com.iplanet.jato.view.ContainerViewBase |
BEGIN_DISPLAY_EVENT_METHOD_PREFIX, BEGIN_DISPLAY_EVENT_METHOD_SUFFIX, END_DISPLAY_EVENT_METHOD_PREFIX, END_DISPLAY_EVENT_METHOD_SUFFIX, eventMethodRegistry, OPTION_ENABLE_QUALIFIELD_CHILD_NAME_LOOKUPS, OPTION_USE_LEGACY_DISPLAY_EVENT_SIGNATURES |
Fields inherited from interface com.iplanet.jato.view.View |
QUALIFIED_VIEW_NAME_SEPARATOR |
Constructor Summary | |
protected |
TiledViewBase()
Default constructor |
|
TiledViewBase(View parent,
java.lang.String name)
Creates a ContainerViewBase with a parent and name |
Method Summary | |
void |
dumpChildValues(java.io.PrintStream out)
Instructs the view to dump the values of its primary model using the names of its registered children to the specifid writer. |
void |
dumpChildValues(java.io.PrintWriter out)
Instructs the view to dump the values of its primary model using the names of its registered children to the specifid writer. |
View |
getChild(java.lang.String name,
int tile)
Returns the named child in the specified tile. |
static java.lang.String[][] |
getChildValues(javax.servlet.http.HttpServletRequest request,
java.lang.String qualifiedParentName,
java.lang.String childName)
This method returns a set of values for a given field within a tiled parent. |
int |
getDisplayIndex()
Returns the current display index during display of this container. |
int |
getMaxDisplayTiles()
Returns the maximum number of tiles this view will display. |
protected java.lang.String |
getNonIndexedQualifiedName()
Returns the default qualified name without a tile index qualfier. |
int |
getNumTiles()
Returns the current number of tiles in this view's primary model. |
DatasetModel |
getPrimaryModel()
Returns the primary model used by this model's iteration and navigation logic. |
java.lang.String |
getQualifiedName()
Returns this view's qualified name. |
int |
getTileIndex()
Returns the current location index of the view's primary model. |
protected int |
incrementDisplayIndex()
Advances the display index by one. |
protected boolean |
isTileDisplayable(int index)
Tests whether the tile specified by the provided index is displayable according to the max display tile limit. |
void |
mapRequestParameters(javax.servlet.http.HttpServletRequest request)
Maps servlet request parameter values into subviews. |
boolean |
nextTile()
Increments the current tile position to the next available tile position. |
protected boolean |
nextTileInternal()
Increments the current tile position to the next available tile position. |
protected void |
resetDisplayIndex()
Resets the display index to indicate that no rows have been displayed |
void |
resetTileIndex()
Resets the primary model to the "before first" state and resets the display index. |
protected void |
setDisplayIndex(int value)
Sets the current display index during display of this container. |
void |
setMaxDisplayTiles(int value)
Sets the maximum number of tiles this view will display. |
void |
setPrimaryModel(DatasetModel value)
Sets the primary model used by this model's iteration and navigation logic. |
void |
setPrimaryModel(Model value)
Deprecated. Use the version of this method that takes a DatasetModel instead. The parameter must be of type DatasetModel or this method will throw a ClassCastException |
void |
setTileIndex(int value)
Sets the current location index of the view's primary model. |
Methods inherited from class com.iplanet.jato.view.ViewBase |
getName, getParent, getParentViewBean, getRootView, getRootView, setName, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.iplanet.jato.view.ContainerView |
beginChildDisplay, beginDisplay, endChildDisplay, endDisplay, getChild, getChildNames, getChildType, getDefaultModel, getDisplayField, getDisplayFieldValue, getNumChildren, resetChildren, setDisplayFieldValue |
Methods inherited from interface com.iplanet.jato.view.View |
getName, getParent, setParent |
Field Detail |
protected static final int UNDEFINED_ROW_INDEX
Constructor Detail |
protected TiledViewBase()
public TiledViewBase(View parent, java.lang.String name)
ContainerViewBase
with a parent and nameparent
- The parent view or null if this view has no parentname
- The logical name of this viewMethod Detail |
protected java.lang.String getNonIndexedQualifiedName()
getQualifiedName()
method, and is needed because the default behavior for that
method must be slightly different for a tiled view.public java.lang.String getQualifiedName()
getQualifiedName
in interface View
getQualifiedName
in class ViewBase
public void dumpChildValues(java.io.PrintStream out) throws ModelControlException
out
- The PrintStream to which to print the diagnostic informationpublic void dumpChildValues(java.io.PrintWriter out) throws ModelControlException
out
- The PrintWriter to which to print the diagnostic informationpublic DatasetModel getPrimaryModel()
public void setPrimaryModel(DatasetModel value)
value
- This view's primary model, used for iteration through tilesDatasetModel
public void setPrimaryModel(Model value)
public View getChild(java.lang.String name, int tile) throws ModelControlException
ModelControlException
, which will be caught and
an IllegalArgumentException
thrown in its place.The named child must be bound to the primary model in order for this method to have the effect of returning the child in the specified tile. Children not bound to the primary model will be returned as usual, though their values will not generally correspond to the current row of the primary model. The primary model's current position will still be set to the specified tile, however.
getChild
in interface TiledView
name
- The logical name of the child to returntile
- The new tile index. The child will effectively be positioned on
this tile if it is bound to the primary model.ModelControlException
- Thrown if the positioning of the primary model to the specified
tile throws a ModelControlExceptionpublic int getNumTiles()
getNumTiles
in interface TiledView
public int getTileIndex() throws ModelControlException
getTileIndex
in interface TiledView
ModelControlException
- Thrown if manipulation of the primary model fails during
this operationpublic void setTileIndex(int value) throws ModelControlException
com.iplanet.jato.model.sql package
).setTileIndex
in interface TiledView
value
- The new tile indexModelControlException
- Thrown if manipulation of the primary model fails during
this operationpublic int getMaxDisplayTiles()
getMaxDisplayTiles
in interface TiledView
public void setMaxDisplayTiles(int value)
setMaxDisplayTiles
in interface TiledView
value
- The number of maximum display tiles or -1 to specify no maximumpublic int getDisplayIndex()
protected void setDisplayIndex(int value)
value
- The new tile display indexprotected void resetDisplayIndex()
protected int incrementDisplayIndex()
protected boolean isTileDisplayable(int index)
index
- The yet-to-be-displayed tile indexpublic void resetTileIndex() throws ModelControlException
resetTileIndex
in interface TiledView
ModelControlException
- Thrown if manipulation of the primary model fails during
this operationpublic boolean nextTile() throws ModelControlException
nextTile
in interface TiledView
protected final boolean nextTileInternal() throws ModelControlException
nextTile()
.public void mapRequestParameters(javax.servlet.http.HttpServletRequest request) throws ModelControlException
This method is called at the beginning of a servlet request in order to initialize this container and its children with values appropriate to the current request.
mapRequestParameters
in interface ContainerView
mapRequestParameters
in class ContainerViewBase
request
- The request object of the current servlet requestpublic static java.lang.String[][] getChildValues(javax.servlet.http.HttpServletRequest request, java.lang.String qualifiedParentName, java.lang.String childName)
<repeated>[0].<child> <repeated>[1].<child> <repeated>[2].<child> ... or <repeated1>[0].<repeated2>[0].<child> <repeated1>[0].<repeated2>[1].<child> <repeated1>[0].<repeated2>[2].<child> <repeated1>[1].<repeated2>[0].<child> ...we need to find the child values that are appropriate to the supplied parent base name.
request
- The current servlet request objectqualifiedParentName
- The qualified name of the parent. Used to resolve parameter
names relative to only the named parent.childName
- The name of the child for which to obtain values
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |