KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > riotfamily > riot > list > ui > ListModel


1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1
3  * The contents of this file are subject to the Mozilla Public License Version
4  * 1.1 (the "License"); you may not use this file except in compliance with
5  * the License. You may obtain a copy of the License at
6  * http://www.mozilla.org/MPL/
7  *
8  * Software distributed under the License is distributed on an "AS IS" basis,
9  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10  * for the specific language governing rights and limitations under the
11  * License.
12  *
13  * The Original Code is Riot.
14  *
15  * The Initial Developer of the Original Code is
16  * Neteye GmbH.
17  * Portions created by the Initial Developer are Copyright (C) 2006
18  * the Initial Developer. All Rights Reserved.
19  *
20  * Contributor(s):
21  * Felix Gnass [fgnass at neteye dot de]
22  *
23  * ***** END LICENSE BLOCK ***** */

24 package org.riotfamily.riot.list.ui;
25
26 import java.util.List JavaDoc;
27
28 /**
29  * @author Felix Gnass [fgnass at neteye dot de]
30  * @since 6.4
31  */

32 public class ListModel {
33
34     private String JavaDoc editorId;
35
36     private String JavaDoc parentId;
37
38     private List JavaDoc columns;
39
40     private List JavaDoc items;
41
42     private List JavaDoc listCommands;
43
44     private int itemCommandCount;
45
46     private int pages;
47
48     private int pageSize;
49
50     private int currentPage;
51
52     private int itemsTotal;
53
54     private String JavaDoc filterFormHtml;
55
56     private String JavaDoc cssClass;
57
58     public ListModel(int itemsTotal, int pageSize, int currentPage) {
59         this.itemsTotal = itemsTotal;
60         this.pageSize = pageSize;
61         this.currentPage = currentPage;
62         if (pageSize > 0) {
63             pages = (int) itemsTotal / pageSize + 1;
64             if (itemsTotal % pageSize == 0) {
65                 pages--;
66             }
67         }
68     }
69
70     public String JavaDoc getEditorId() {
71         return this.editorId;
72     }
73
74     public void setEditorId(String JavaDoc editorId) {
75         this.editorId = editorId;
76     }
77
78     public String JavaDoc getParentId() {
79         return this.parentId;
80     }
81
82     public void setParentId(String JavaDoc parentId) {
83         this.parentId = parentId;
84     }
85
86     public List JavaDoc getColumns() {
87         return this.columns;
88     }
89
90     public void setColumns(List JavaDoc columns) {
91         this.columns = columns;
92     }
93
94     public List JavaDoc getItems() {
95         return this.items;
96     }
97
98     public void setItems(List JavaDoc items) {
99         this.items = items;
100     }
101
102     public List JavaDoc getListCommands() {
103         return this.listCommands;
104     }
105
106     public void setListCommands(List JavaDoc listCommands) {
107         this.listCommands = listCommands;
108     }
109
110     public int getItemCommandCount() {
111         return this.itemCommandCount;
112     }
113
114     public void setItemCommandCount(int itemCommandCount) {
115         this.itemCommandCount = itemCommandCount;
116     }
117
118     public int getCurrentPage() {
119         return this.currentPage;
120     }
121
122     public int getItemsTotal() {
123         return this.itemsTotal;
124     }
125
126     public int getPages() {
127         return this.pages;
128     }
129
130     public int getPageSize() {
131         return this.pageSize;
132     }
133
134     public String JavaDoc getFilterFormHtml() {
135         return this.filterFormHtml;
136     }
137
138     public void setFilterFormHtml(String JavaDoc filterFormHtml) {
139         this.filterFormHtml = filterFormHtml;
140     }
141
142     public String JavaDoc getCssClass() {
143         return this.cssClass;
144     }
145
146     public void setCssClass(String JavaDoc cssClass) {
147         this.cssClass = cssClass;
148     }
149
150 }
151
Popular Tags