Class ViewContext<T>
java.lang.Object
org.deltava.commands.ViewContext<T>
- Type Parameters:
T
- the result object type
A bean to store scrollable view page parameters.
- Since:
- 1.0
- Version:
- 10.0
- Author:
- Luke
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Request parameter to store view window size.static final String
Request parameter to store sort type.static final String
Request parameter to store start position.static final String
Request attribute to store view data for presentation-layer JSPs. -
Constructor Summary
ConstructorsConstructorDescriptionViewContext
(HttpServletRequest req, int size) Initializes the view context from the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Returns the number of entries in the view to display.int
getEnd()
Returns the position of the end of this view slice.Returns all the request parameters for this view slice, minus any reserved parametersint
Gets the start position of the previous slice of the view (for the Page Up tag)Returns the result data to display.Gets the sort parameter for this view slice.int
getStart()
Returns the start of this slice of the view.boolean
Returns if we are at the end of the view.void
setResults
(Collection<T> results) Updates the result data for this view slice.void
setSortType
(String sortType) Sets the default sort parameter for this view slice.
-
Field Details
-
VIEW_CONTEXT
Request attribute to store view data for presentation-layer JSPs.- See Also:
-
START
-
COUNT
-
SORTBY
-
-
Constructor Details
-
ViewContext
Initializes the view context from the HTTP request.- Parameters:
req
- the HTTP requestsize
- the size of the viewport
-
-
Method Details
-
getStart
public int getStart()Returns the start of this slice of the view.- Returns:
- the start position
- See Also:
-
getCount
public int getCount()Returns the number of entries in the view to display.- Returns:
- the number of entries
- See Also:
-
getEnd
public int getEnd()Returns the position of the end of this view slice.- Returns:
- the end position
-
getParameters
-
getResults
Returns the result data to display.- Returns:
- a Collection of beans
- See Also:
-
getSortType
Gets the sort parameter for this view slice.- Returns:
- the sort parameter
- See Also:
-
getPreviousStart
public int getPreviousStart()Gets the start position of the previous slice of the view (for the Page Up tag)- Returns:
- the start position of the previous slice, or zero if negative
- See Also:
-
isEndOfView
public boolean isEndOfView()Returns if we are at the end of the view.- Returns:
- TRUE if no more data is available, otherwise FALSE
-
setResults
Updates the result data for this view slice.- Parameters:
results
- a List of beans- See Also:
-
setSortType
Sets the default sort parameter for this view slice.- Parameters:
sortType
- the sort parameter- See Also:
-