Java Doc for PagerModel.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » databinding » datagrid » api » pager » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.databinding.datagrid.api.pager 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.beehive.netui.databinding.datagrid.api.pager.PagerModel

PagerModel
public class PagerModel implements java.io.Serializable(Code)

The PagerModel is a JavaBean that represents the page state of a data grid. In the default implementation, the page state consists of three pieces of data:

  • the current row
  • current page
  • the href / action used to page through data
This pager model implementation is row based which means that the notion of the current page is based on which row is at the top of a page. Row numbering starts at zero and continues to page size. For example, in a data grid on its first page and with a page size of 10, the rows 0-9 will be displayed. The next page would contain rows 10-11 and so on.

The pager model provides JavaBean-style access to the properties of a pager. In addition, it provides read-only access to information about the row to use in order to navigate to a specific page. To navigate to the previous page, the PagerModel.getRowForPreviousPage() will return the row number that will appear at the top of the previous page. In order to build effective paging UI, it is also often useful to know the absolute page number. As with row numbers, page numbers are zero based. For example, if a data set displayed in a data grid has 30 records and the grid is on page a page displaying rows 10-19, the current page is 1. When displaying this value in UI, it is often useful to display it as:

 Page 2 of 3
 
Random page access can also be accomplished using the PagerModel.encodeRowForPage(int) method which will return the row number to display when jumping to a specific page in a grid.



Field Summary
final public static  intDEFAULT_PAGE_SIZE
    
final public static  intDEFAULT_ROW
    

Constructor Summary
public  PagerModel()
     Default constructor.

Method Summary
public  intencodeRowForPage(int page)
    
public  intgetDataSetSize()
     Set the data set size.
public  intgetDefaultPageSize()
     Get the default page size.
public  intgetFirstPage()
     Get the page number of the first page.
public  intgetLastPage()
     Get the page number for the last page.
public  intgetLastRowForPage()
    

Get the last row for the current page of data.

public  intgetNextPage()
     Get the page number for the next page.
public  intgetPage()
     Get the page number given the current page size and current row.
public  StringgetPageAction()
     Get the action used when building URLs for navigating to another page.
public  intgetPageCount()
     Get the total number of pages.
public  StringgetPageHref()
     Get the href used when building URLs for navigating to another page.
public  intgetPageSize()
     Get the current page size.
public  intgetPreviousPage()
     Get the page number of the previous page.
public  intgetRow()
     Get the current row.
public  intgetRowForFirstPage()
     Get the row used to display the first page.
public  intgetRowForLastPage()
     Get the row used to display the last page.
public  intgetRowForNextPage()
     Get the row used to display the next page.
public  intgetRowForPreviousPage()
     Get the row used to display the previous page.
public  voidsetDataSetSize(int dataSetSize)
     Set the data set size.
public  voidsetDefaultPageSize(int pageSize)
     Set the default page size.
public  voidsetPage(int page)
     Set a specific page.
public  voidsetPageAction(String pageAction)
     Set the action used to navigate to another page.
public  voidsetPageHref(String pageHref)
     Set the href used to navigate to another page.
public  voidsetPageSize(int pageSize)
     Sets the page size and overrides the default page size if one has been set.
public  voidsetRow(int row)
     Set the current row.

Field Detail
DEFAULT_PAGE_SIZE
final public static int DEFAULT_PAGE_SIZE(Code)



DEFAULT_ROW
final public static int DEFAULT_ROW(Code)




Constructor Detail
PagerModel
public PagerModel()(Code)
Default constructor. This initializes the current row to the default row value PagerModel.DEFAULT_ROW .




Method Detail
encodeRowForPage
public int encodeRowForPage(int page)(Code)
Get the row needed to jump to the given page
Parameters:
  page - the new page the row used to jump to the new page
throws:
  IllegalArgumentException - if the given page value is less than zero



getDataSetSize
public int getDataSetSize()(Code)
Set the data set size. In order to calculate paging state for the last page such as the state returned for PagerModel.getRowForLastPage() the default PagerModel implementation must know the total size of the data set. the size



getDefaultPageSize
public int getDefaultPageSize()(Code)
Get the default page size. If no page size has been set via PagerModel.setDefaultPageSize(int) this value is PagerModel.DEFAULT_PAGE_SIZE the default page size



getFirstPage
public int getFirstPage()(Code)
Get the page number of the first page. the first page



getLastPage
public int getLastPage()(Code)
Get the page number for the last page. the last page



getLastRowForPage
public int getLastRowForPage()(Code)

Get the last row for the current page of data. This value is useful when displaying paging UI like:

 Row 11 through 20 of 60
 
The last row on the page is returned as a zero-based number from the beginning of the data set. In the case above, the value returned is 19 and is converted to 20 for readability by adding one. If the current page is only partially filled, this method will return the value for a partial page. For example, with a data set of size 4 on a page of size 10, the value 3 would be returned.

the last row for the current page



getNextPage
public int getNextPage()(Code)
Get the page number for the next page. the next page



getPage
public int getPage()(Code)
Get the page number given the current page size and current row. The page number is zero based and should be adjusted by one when being displayed to users. the page number



getPageAction
public String getPageAction()(Code)
Get the action used when building URLs for navigating to another page. the action name or null if no action name is set



getPageCount
public int getPageCount()(Code)
Get the total number of pages. This value is useful when displaying the total number of pages in UI like:
 Page 4 of 10
 
This method returns an absolute count of the number of pages which could be displayed given the size of the data set and the current page size. This method requires the PagerModel know the total size of the data set. the number of pages
throws:
  IllegalStateException - when the size of the data set has not been set



getPageHref
public String getPageHref()(Code)
Get the href used when building URLs for navigating to another page. the href or null if no href is set



getPageSize
public int getPageSize()(Code)
Get the current page size. the page size



getPreviousPage
public int getPreviousPage()(Code)
Get the page number of the previous page. the previous page



getRow
public int getRow()(Code)
Get the current row. If no row has been specified, the default row is returned. the current row



getRowForFirstPage
public int getRowForFirstPage()(Code)
Get the row used to display the first page. the row for the first page



getRowForLastPage
public int getRowForLastPage()(Code)
Get the row used to display the last page. This requires tha the data set size has been set via the row for the last page
throws:
  IllegalStateException - when the size of the data set has not been set



getRowForNextPage
public int getRowForNextPage()(Code)
Get the row used to display the next page. Note, if this value is greater than the size of the data set it would scroll off the end of the data set and is invalid. the row for the previous page



getRowForPreviousPage
public int getRowForPreviousPage()(Code)
Get the row used to display the previous page. Note, a return value of less than zero means that the previous page does not exist as it would scroll off the beginning of the data set and is invalid. the row for the previous page



setDataSetSize
public void setDataSetSize(int dataSetSize)(Code)
Set the data set size.
Parameters:
  dataSetSize - the size



setDefaultPageSize
public void setDefaultPageSize(int pageSize)(Code)
Set the default page size. The default page size is used when no other page size has been set and is useful when clients wish to occasionally override the page size but wish to have the default page size set differently than the PagerModel's default.
Parameters:
  pageSize - the new page size
throws:
  IllegalArgumentException - if the page size is less than 1



setPage
public void setPage(int page)(Code)
Set a specific page. This will change the current row to match the given page value.
Parameters:
  page - the new page
throws:
  IllegalArgumentException - if the given page is less than zero



setPageAction
public void setPageAction(String pageAction)(Code)
Set the action used to navigate to another page.
Parameters:
  pageAction - the action name



setPageHref
public void setPageHref(String pageHref)(Code)
Set the href used to navigate to another page.
Parameters:
  pageHref - the href



setPageSize
public void setPageSize(int pageSize)(Code)
Sets the page size and overrides the default page size if one has been set.
Parameters:
  pageSize - the specific page size



setRow
public void setRow(int row)(Code)
Set the current row.
Parameters:
  row - the new row
throws:
  IllegalArgumentException - if the given row is less than zero



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.