KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > strutsutil > ModelListForm


1 /**
2  * Copyright 2003-2006 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6
7  http://www.apache.org/licenses/LICENSE-2.0
8
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */

15
16 package com.jdon.strutsutil;
17
18 import com.jdon.controller.model.ModelIF;
19 import org.apache.struts.action.ActionForm;
20 import java.util.*;
21
22 /**
23  * Model collection class that will be iterated by jsp this is a subclass of
24  * struts's ActionForm it include all model colletion that fit for query
25  * condition
26  *
27  * this class always collaborate with the concrete class of ModelListAction
28  *
29  *
30  *
31  * this class must be configured in struts-config.xml
32  *
33  * <form-bean name="listForm" type="com.jdon.strutsutil.ModelListForm" />
34  *
35  * @author banq
36  * @see ModellistAction PageIterator
37  *
38  */

39 public class ModelListForm extends ActionForm {
40
41     /**
42      * the count of all models that fit for query condition
43      */

44     private int allCount = 0;
45
46     /**
47      * current page start sequence
48      */

49     private int start = 0;
50
51     /**
52      * the count of current page models
53      */

54     private int count = 30;
55    
56
57     /**
58      * a model that express 1:N N is below model collection
59      */

60     private ModelIF oneModel = null;
61     
62     /**
63      * models collection of current page
64      */

65     private Collection list = new ArrayList();
66
67     public Collection getList() {
68         return list;
69     }
70
71     public void setList(Collection list) {
72         this.list = list;
73     }
74
75     public int getCount() {
76         return (this.count);
77     }
78
79     public void setCount(int count) {
80         this.count = count;
81     }
82
83     public int getAllCount() {
84         return (this.allCount);
85     }
86
87     public void setAllCount(int allCount) {
88         this.allCount = allCount;
89     }
90
91     public int getStart() {
92         return (this.start);
93     }
94
95     public void setStart(int start) {
96         this.start = start;
97     }
98
99   
100     public ModelIF getOneModel() {
101         return oneModel;
102     }
103
104     public void setOneModel(ModelIF oneModel) {
105         this.oneModel = oneModel;
106     }
107     
108
109 }
110
Popular Tags