01: /* Pageable.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Fri Jun 29 17:17:01 2007, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul.ext;
20:
21: import org.zkoss.zk.ui.WrongValueException;
22:
23: /**
24: * Denotes a component that can be displayed in multiple pages.
25: *
26: * <p>Note: a component that can be displayed in multiple pages
27: * can be implemented in two ways.
28: *
29: * <p>1) If it can be controlled by a paging controller
30: * (i.e., {@link Paginal}), it shall hold an reference to one of
31: * the paging controllers.
32: *
33: * <p>2) If it cannot be controlled, it shall implement
34: * the {@link Pageable} interface.
35: *
36: * @author tomyeh
37: * @since 2.4.1
38: * @see Paginal
39: */
40: public interface Pageable {
41: /** Returns the number of items per page.
42: * <p>Default: 20.
43: */
44: public int getPageSize();
45:
46: /** Sets the number of items per page.
47: */
48: public void setPageSize(int size) throws WrongValueException;
49:
50: /** Returns the number of pages.
51: * Note: there is at least one page even no item at all.
52: */
53: public int getPageCount();
54:
55: /** Returns the active page (starting from 0).
56: */
57: public int getActivePage();
58:
59: /** Sets the active page (starting from 0).
60: */
61: public void setActivePage(int pg) throws WrongValueException;
62: }
|