org.apache.beehive.netui.databinding.datagrid.api
Class DataGridConfig

Object
  extended by DataGridConfig
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DefaultDataGridConfig

public abstract class DataGridConfig
extends Object
implements Serializable

Abstract class used by the data grid to create model objects used for state management and rendering. This abstraction exists in order to allow the data grid's implementation to be configurable. Various data grid implementation classes are exposed here including sorting, filtering, and paging. In addition, classes such as the PagerRenderer and StyleModel are created by subclasses in order to provide a data grid specific implementation of pager UI or style support.

By default, DataGridConfig implementations are not thread safe, but custom implementations are free to store instance state as long as the DataGridConfig object lifetimes are managed in user code.

A specific DataGridConfig object can be created and passed to a data grid via the data grid's DataGrid.setDataGridConfig(DataGridConfig) method.

See Also:
Serialized Form

Constructor Summary
DataGridConfig()
           
 
Method Summary
abstract  DataGridState createDataGridState()
           Create a DataGridState instance that will be used to store the state for a data grid.
abstract  Filter createFilter()
           Create a concrete Filter implementation for a data grid.
abstract  FilterModel createFilterModel(List filters)
           Create a FilterModel instance used to store the Filter state for a data grid.
abstract  PagerModel createPagerModel()
           Create a PagerModel instance used to store the current paging state for a data grid.
abstract  Sort createSort()
           Create a concrete Sort implementation for a data grid.
abstract  SortModel createSortModel(List sorts)
           Create a SortModel instance used to store the Sort state for a data grid.
abstract  DataGridStateCodec createStateCodec(ServletRequest request, String gridName)
           Create a DataGridStateCodec instance used to obtain services for handling data grid state.
abstract  PagerRenderer getDefaultPagerRenderer()
           Create a concrete PagerRenderer implementation that will be used to render the pager in the absence of an alternate pager renderer.
abstract  DataGridResourceProvider getDefaultResourceProvider()
           Create the default DataGridResourceProvider.
abstract  DataGridResourceProvider getResourceProvider(String resourceBundle)
           Create a DataGridConfig-specific implementation of a DataGridResourceProvider.
abstract  StyleModel getStyleModel(String name, String classPrefix)
           Create a StyleModel used by a data grid to render styles onto various HTML markup elements generated by a data grid.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataGridConfig

public DataGridConfig()
Method Detail

createDataGridState

public abstract DataGridState createDataGridState()

Create a DataGridState instance that will be used to store the state for a data grid. This method will be called only when a DataGridState object needs to be manufactured by a data grid tag.

Returns:
the DataGridState object for a data grid.

createSort

public abstract Sort createSort()

Create a concrete Sort implementation for a data grid. When the sort state of a data grid is created, this Sort instance will contain a single sort.

Returns:
a Sort instance

createSortModel

public abstract SortModel createSortModel(List sorts)

Create a SortModel instance used to store the Sort state for a data grid.

Parameters:
sorts - the current List of sorts for a data grid
Returns:
the SortModel

createFilter

public abstract Filter createFilter()

Create a concrete Filter implementation for a data grid. When the filter state of a data grid is created, this Filter instance will contain a single filter.

Returns:
a Filter instance

createFilterModel

public abstract FilterModel createFilterModel(List filters)

Create a FilterModel instance used to store the Filter state for a data grid.

Parameters:
filters - the current List of filters for a data grid
Returns:
a FilterModel

createPagerModel

public abstract PagerModel createPagerModel()

Create a PagerModel instance used to store the current paging state for a data grid.

Returns:
a PagerModel

createStateCodec

public abstract DataGridStateCodec createStateCodec(ServletRequest request,
                                                    String gridName)

Create a DataGridStateCodec instance used to obtain services for handling data grid state.

Parameters:
request - the current ServletRequest
gridName - the name of a data grid whose DataGridStateCodec to obtain
Returns:
a DataGridStateCodec

getDefaultResourceProvider

public abstract DataGridResourceProvider getDefaultResourceProvider()

Create the default DataGridResourceProvider. A resource provider is an implementation of the DataGridResourceProvider which is used during data grid rendering to obtain strings for messages, paths, etc. The default resource provider simply exposes the default data grid messages stored in the properties file located at:

   org.apache.beehive.netui.databinding.datagrid.runtime.util.data-grid-default.properties
 

Returns:
a DataGridResourceProvider

getResourceProvider

public abstract DataGridResourceProvider getResourceProvider(String resourceBundle)

Create a DataGridConfig-specific implementation of a DataGridResourceProvider. The DataGridConfig instance should use the provided resource bundle path to create a DataGridResourceProvider which will expose those messages into the data grid for rendering.

Parameters:
resourceBundle - the resource bundle to use for grid messages
Returns:
a DataGridResourceProvider

getStyleModel

public abstract StyleModel getStyleModel(String name,
                                         String classPrefix)

Create a StyleModel used by a data grid to render styles onto various HTML markup elements generated by a data grid.

Parameters:
name - the name of a style type to support. This name can vary by DataGridConfig implementation subclasses may use this value to configure the type of StyleModel returned to the caller.
classPrefix - an optional prefix to use when generating style class names
Returns:
the StyleModel

getDefaultPagerRenderer

public abstract PagerRenderer getDefaultPagerRenderer()

Create a concrete PagerRenderer implementation that will be used to render the pager in the absence of an alternate pager renderer.

Returns:
the default PagerRenderer used to render a paging user interface