Skip to content

Commit

Permalink
Clean up PaginatorSnippet scaladocs a little.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowfiend committed Jan 28, 2017
1 parent f0f6019 commit 3d7735e
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions web/webkit/src/main/scala/net/liftweb/http/Paginator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import util._
import S.?

/**
* Base class for things that require pagination. Implements a contract
* Base class for things that require pagination. Implements a contract
* for supplying the correct number of browsable pages etc
*
* @tparam T the type of item being paginated
Expand Down Expand Up @@ -71,9 +71,9 @@ trait Paginator[T] extends Loggable {
}

/**
* In many situations you'll want to sort things in your paginated view.
* In many situations you'll want to sort things in your paginated view.
* <code>SortedPaginator</code> is a specialized paginator for doing such tasks.
*
*
* T: The type of the elements, accessed via def page within the listing snippet
* C: The type of the columns, used to specify sorting
*
Expand Down Expand Up @@ -117,19 +117,11 @@ trait SortedPaginator[T, C] extends Paginator[T] {
}

/**
* This is the paginator snippet. It provides page
* navigation and column sorting links.
* View XHTML is as follows:
* nav prefix (prefix is configurable by overriding def navPrefix)
* - &lt;nav:first/&gt; - a link to the first page
* - &lt;nav:prev/&gt; - a link to the previous page
* - &lt;nav:allpages/&gt; - individual links to all pages. The contents of this node are used to separate page links.
* - &lt;nav:next/&gt; - a link to the next page
* - &lt;nav:last/&gt; - a link to the last page
* - &lt;nav:records/&gt; - a description of which records are currently being displayed
* - &lt;nav:recordsFrom/&gt; - the first record number being displayed
* - &lt;nav:recordsTo/&gt; - the last record number being displayed
* - &lt;nav:recordsCount/&gt; - the total number of records on all pages
* This is the paginator snippet. It provides page navigation and column sorting
* links.
*
* The values for the pagination are bound according to the classes specified in
* the [[paginate]] method, using a CSS selector transform.
*
* @author nafg and Timothy Perrett
*/
Expand All @@ -150,7 +142,7 @@ trait PaginatorSnippet[T] extends Paginator[T] {
* The "last page" link text
*/
def lastXml: NodeSeq = Text(?(">>"))

/**
* How to display the page's starting record
*/
Expand All @@ -162,7 +154,7 @@ trait PaginatorSnippet[T] extends Paginator[T] {
/**
* The status displayed when using &lt;nav:records/&gt; in the template.
*/
def currentXml: NodeSeq =
def currentXml: NodeSeq =
if(count==0)
Text(S.?("paginator.norecords"))
else
Expand Down Expand Up @@ -226,14 +218,14 @@ trait PaginatorSnippet[T] extends Paginator[T] {
* code.
*
* Classes used to bind:
* - `first`: link to go back to the first page (populated by `firstXml`)
* - `prev`: link to go to previous page (populated by `prevXml`)
* - `all-pages`: container for all pages (populated by `pagesXml`)
* - `zoomed-pages`: container for `zoomedPages` (populated by `pagesXml`)
* - `next`: link to go to next page (populated by `nextXml`)
* - `last`: link to go to last page (populated by `lastXml`)
* - `first`: link to go back to the first page (populated by `[[firstXml]]`)
* - `prev`: link to go to previous page (populated by `[[prevXml]]`)
* - `all-pages`: container for all pages (populated by `[[pagesXml]]`)
* - `zoomed-pages`: container for `zoomedPages` (populated by `[[pagesXml]]`)
* - `next`: link to go to next page (populated by `[[nextXml]]`)
* - `last`: link to go to last page (populated by `[[lastXml]]`)
* - `records`: currently visible records + total count (populated by
* `currentXml`)
* `[[currentXml]]`)
* - `records-start`: start of currently visible records
* - `records-end`: end of currently visible records
* - `records-count`: total records count
Expand Down Expand Up @@ -325,8 +317,8 @@ trait SortedPaginatorSnippet[T, C] extends SortedPaginator[T, C] with PaginatorS
}

/**
* Sort your paginated views by using lifts functions mapping.
* The only down side with this style is that your links are session
* Sort your paginated views by using lifts functions mapping.
* The only down side with this style is that your links are session
* specific and non-bookmarkable.
* If you mix this trait in to a StatefulSnippet, it should work out the box.
* Otherwise, implement 'registerThisSnippet.'
Expand Down

0 comments on commit 3d7735e

Please sign in to comment.