Class ViewContext<T>

java.lang.Object
org.deltava.commands.ViewContext<T>
Type Parameters:
T - the result object type

public class ViewContext<T> extends Object
A bean to store scrollable view page parameters.
Since:
1.0
Version:
10.0
Author:
Luke
  • Field Details

  • Constructor Details

    • ViewContext

      public ViewContext(HttpServletRequest req, int size)
      Initializes the view context from the HTTP request.
      Parameters:
      req - the HTTP request
      size - 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

      public Map<String,String> getParameters()
      Returns all the request parameters for this view slice, minus any reserved parameters
      Returns:
      the parameters to the request
    • getResults

      public Collection<T> getResults()
      Returns the result data to display.
      Returns:
      a Collection of beans
      See Also:
    • getSortType

      public String 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

      public void setResults(Collection<T> results)
      Updates the result data for this view slice.
      Parameters:
      results - a List of beans
      See Also:
    • setSortType

      public void setSortType(String sortType)
      Sets the default sort parameter for this view slice.
      Parameters:
      sortType - the sort parameter
      See Also: