|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDataGridTagModel
public class DataGridTagModel
The DataGridTagModel is a JavaBean that is exposed by the NetUI data grid tag into
the PageContext
in a JSP. This bean exposes state and services
which can be data bound by an expression language in a JSP.
Field Summary | |
---|---|
static int |
RENDER_STATE_CAPTION
The render state used when the data grid is rendering the caption tag. |
static int |
RENDER_STATE_END
The render state used when the data grid has completed rendering. |
static int |
RENDER_STATE_FOOTER
The render state used when the data grid is rendering the footer. |
static int |
RENDER_STATE_GRID
The render state used when the data grid is rendering the data rows. |
static int |
RENDER_STATE_HEADER
The render state used when the data grid is rendering the header tag. |
static int |
RENDER_STATE_START
The render state used when the data grid performs its first pass through its tag body. |
Constructor Summary | |
---|---|
DataGridTagModel(String name,
DataGridConfig dataGridConfig,
JspContext jspContext)
Constructor used to build a DataGridTagModel. |
Method Summary | |
---|---|
void |
addResourceOverride(String key,
String value)
This method provides support for overriding the messages available in the DataGridResourceProvider on a
per-message basis. |
void |
changeRenderState(int renderState)
Method that alters the data grid's current render to the new renderState . |
String |
formatMessage(String key,
Object[] args)
Format a message given a resource string name key and a set of
formatting arguments args . |
int |
getCurrentIndex()
Accessor for obtaining the current index in the data set. |
Object |
getCurrentItem()
Accessor for obtaining the current item in the data set. |
PagedDataSet |
getDataSet()
Accessor for the PagedDataSet that is used to render a data set in the grid. |
String |
getDataSource()
Accessor for obtaining the data source expression that was used to data bind to the data set. |
String |
getDefaultSortImagePath()
Get the default image path used when constructing links to sort images. |
JspContext |
getJspContext()
Accessor for the JspContext for the JSP in which the grid started to render. |
String |
getMessage(String key)
Get a message given a resource string name key . |
String |
getName()
Accessor for the name of the data grid. |
PagerRenderer |
getPagerRenderer()
Accessor for the PagerRenderer . |
int |
getRenderState()
Accessor for the current render state. |
String |
getResourcePath()
Get the resourrce path used when creating HTML image links during data grid rendering. |
DataGridResourceProvider |
getResourceProvider()
Get the DataGridResourceProvider used to provide string messages, paths, etc during
data grid rendering. |
String |
getSortImagePath(SortDirection sortDirection)
Get the image paths used for the given SortDirection . |
DataGridState |
getState()
Accessor for obtaining the DataGridState object. |
StyleModel |
getStyleModel()
Get the StyleModel used to create style classes during data grid rendering. |
TableRenderer |
getTableRenderer()
Get the instance of TableRenderer that is used to render HTML table markup for a data grid. |
DataGridURLBuilder |
getUrlBuilder()
Accessor for obtaining the DataGridURLBuilder object. |
boolean |
hasNextDataItem()
Accessor for determining if there is another item in the data set. |
boolean |
isDisableDefaultPagerRendering()
Check to see if the data grid will render its pager UI by default. |
boolean |
isRenderRowGroups()
Get the flag for whether to render the data grid using HTML row groups. |
Object |
nextDataItem()
Accessor for getting the next item in the data set. |
void |
renderPager(AbstractRenderAppender appender)
Method used to render the data grid's pager UI into the given AbstractRenderAppender . |
void |
setDataSet(PagedDataSet dataSet)
Setter for the PagedDataSet object. |
void |
setDisableDefaultPagerRendering(boolean disableDefaultPagerRendering)
Set a boolean to enable or disable rendering the pager UI by default. |
void |
setPagerRenderer(PagerRenderer pagerRenderer)
Set the PagerRenderer used to render the paging UI for the data grid. |
void |
setRenderRowGroups(boolean renderRowGroups)
Set whether to render the data grid using HTML row groups. |
void |
setResourceProvider(DataGridResourceProvider resourceProvider)
Set the DataGridResourceProvider used to render the data grid. |
void |
setStyleModel(StyleModel styleModel)
Set the StyleModel used to create style classes during data grid rendering. |
void |
setTableRenderer(TableRenderer tableRenderer)
Set the TableRenderer used to render HTML table markup for a data grid. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RENDER_STATE_START
public static final int RENDER_STATE_CAPTION
public static final int RENDER_STATE_HEADER
public static final int RENDER_STATE_GRID
public static final int RENDER_STATE_FOOTER
public static final int RENDER_STATE_END
Constructor Detail |
---|
public DataGridTagModel(String name, DataGridConfig dataGridConfig, JspContext jspContext)
name
- the name of the data griddataGridConfig
- the DataGridConfig
object for a data gridjspContext
- the JspContext
for the JSP in which the data grid's rendering startedMethod Detail |
---|
public String getName()
public JspContext getJspContext()
JspContext
for the JSP in which the grid started to render.
JspContext
public int getRenderState()
Accessor for the current render state. This should be used by clients that need to affect their behavior based on the data grid's current render state. This value will be one of:
RENDER_STATE_START
RENDER_STATE_CAPTION
RENDER_STATE_HEADER
RENDER_STATE_GRID
RENDER_STATE_FOOTER
RENDER_STATE_END
public void changeRenderState(int renderState)
Method that alters the data grid's current render to the new renderState
. If
the provided render state value is unknown, an IllegalStateException
is thrown. The
data grid cycles through its state in this order:
RENDER_STATE_START
RENDER_STATE_CAPTION
RENDER_STATE_HEADER
RENDER_STATE_GRID
RENDER_STATE_FOOTER
RENDER_STATE_END
renderState
- the DataGridTagModel's new render state
IllegalStateException
- if an invalid state is providedpublic PagedDataSet getDataSet()
PagedDataSet
that is used to render a data set in the grid.
PagedDataSet
for the current data setpublic void setDataSet(PagedDataSet dataSet)
PagedDataSet
object. In order to canonicalize the type used by
the data grid to manipulate the data set, the PagedDataSet
is used to
navigate the data set.
dataSet
- the data setpublic PagerRenderer getPagerRenderer()
PagerRenderer
. This is the PagerRenderer
instance that
will be used to render the UI used to display the pager.
PagerRenderer
for the data gridpublic void setPagerRenderer(PagerRenderer pagerRenderer)
PagerRenderer
used to render the paging UI for the data grid.
pagerRenderer
- the PagerRenderer
to usepublic DataGridResourceProvider getResourceProvider()
DataGridResourceProvider
used to provide string messages, paths, etc during
data grid rendering.
DataGridResourceProvider
public void setResourceProvider(DataGridResourceProvider resourceProvider)
DataGridResourceProvider
used to render the data grid.
resourceProvider
- the new resource providerpublic boolean isDisableDefaultPagerRendering()
true
if default rendering is enabled; false
otherwise.public void setDisableDefaultPagerRendering(boolean disableDefaultPagerRendering)
true
, the
data grid rendering tags will produce the pager markup in some default location. If false
the default pager rendering will be disabled. The default location is determined by the tags
doing the rendering.
disableDefaultPagerRendering
- boolean for enabling or disabling rendering the pager in the default locationpublic boolean isRenderRowGroups()
Get the flag for whether to render the data grid using HTML row groups. Row groups include the HTML
thead
, tbody
, and tfoot
tags. If row group rendering is enabled,
the HTML produced by the data grid will be contained inside of these tags and rendered in the correct
order in the produced HTML. More detail on row groups can be found
here.
true
if row groups will be rendered; false
otherwisepublic void setRenderRowGroups(boolean renderRowGroups)
isRenderRowGroups()
.
renderRowGroups
- true
if rendering row groups; false
otherwisepublic TableRenderer getTableRenderer()
TableRenderer
that is used to render HTML table markup for a data grid.
TableRenderer
public void setTableRenderer(TableRenderer tableRenderer)
TableRenderer
used to render HTML table markup for a data grid.
tableRenderer
- the TableRenderer
to use for renderingpublic StyleModel getStyleModel()
StyleModel
used to create style classes during data grid rendering.
StyleModel
public void setStyleModel(StyleModel styleModel)
StyleModel
used to create style classes during data grid rendering.
styleModel
- the StyleModel
public String getMessage(String key)
key
.
key
- the message key
public String formatMessage(String key, Object[] args)
key
and a set of
formatting arguments args
.
key
- the message keyargs
- the arguments used when formatting the message
public void addResourceOverride(String key, String value)
This method provides support for overriding the messages available in the DataGridResourceProvider
on a
per-message basis. The key and value parameters here will override (or add) a message available via
the DataGridResourceProvider
without requiring an entire Java properties file or custom
DataGridResourceProvider
implementation.
key
- the key of the message to overridevalue
- the new value for the message keypublic String getResourcePath()
Get the resourrce path used when creating HTML image links during data grid rendering. The value of the
default resource path is the HttpServletRequest.getContextPath()
combined
with the value of the data grid message stringn obtained with the key IDataGridMessageKeys.DATAGRID_RESOURCE_PATH
.
public String getSortImagePath(SortDirection sortDirection)
Get the image paths used for the given SortDirection
. The image paths are discovered
by using the following mapping.
DataGridResourceProvider
obtained
via getResourceProvider()
using the message key in the table above.
sortDirection
- the SortDirection
used to lookup an image path
public String getDefaultSortImagePath()
DataGridResourceProvider
obtained using getResourceProvider()
using the IDataGridMessageKeys.SORT_NONE_IMAGE_PATH
key.
public void renderPager(AbstractRenderAppender appender)
AbstractRenderAppender
.
appender
- the AbstractRenderAppender
into which the pager will be renderedpublic DataGridState getState()
DataGridState
object. This is a JavaBean
property that can be accessed via an expression language in order to obtain
access to the state information for the data grid stored in the returned object.
DataGridState
public DataGridURLBuilder getUrlBuilder()
DataGridURLBuilder
object. This is a JavaBean
that can be accessed via an expression language in order to obtain access to the
URL information for the data grid stored in the returned object.
DataGridURLBuilder
public int getCurrentIndex()
public Object getCurrentItem()
public String getDataSource()
public Object nextDataItem()
null
.public boolean hasNextDataItem()
true
if there is a next item; false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |