KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > config > SearchSettings


1 package org.contineo.core.config;
2
3 import javax.servlet.http.HttpServletRequest JavaDoc;
4 import org.apache.struts.action.ActionMapping;
5 import org.apache.struts.validator.ValidatorForm;
6
7 /**
8  * Created on 02.01.2005
9  * @author Michael Scholz
10  */

11 public class SearchSettings extends ValidatorForm {
12     
13     private static final long serialVersionUID = 1L;
14     private String JavaDoc username;
15     private int maxFragments;
16     private String JavaDoc representation;
17     private int screenSize;
18     
19     public final static int DEFAULT_MAXFRAGMENTS = 3;
20     public final static int DEFAULT_SCREENSIZE = 4;
21     public final static String JavaDoc DEFAULT_REPRESENTATION = "text";
22
23     /**
24      *
25      */

26     public SearchSettings() {
27         username = "";
28         maxFragments = 0;
29         representation = "";
30         screenSize = 0;
31     }
32
33     /**
34      * @return Returns the maxFragments.
35      * @uml.property name="maxFragments"
36      */

37     public int getMaxFragments() {
38         return maxFragments;
39     }
40     
41     /**
42      * @param maxFragments The maxFragments to set.
43      * @uml.property name="maxFragments"
44      */

45     public void setMaxFragments(int maxFragments) {
46         this.maxFragments = maxFragments;
47     }
48     
49     /**
50      * @return Returns the representation.
51      * @uml.property name="representation"
52      */

53     public String JavaDoc getRepresentation() {
54         return representation;
55     }
56     
57     /**
58      * @param representation The representation to set.
59      * @uml.property name="representation"
60      */

61     public void setRepresentation(String JavaDoc representation) {
62         this.representation = representation;
63     }
64     
65     /**
66      * @return Returns the username.
67      * @uml.property name="username"
68      */

69     public String JavaDoc getUsername() {
70         return username;
71     }
72     
73     /**
74      * @param username The username to set.
75      * @uml.property name="username"
76      */

77     public void setUsername(String JavaDoc username) {
78         this.username = username;
79     }
80         
81     /**
82      * @return Returns the screenSize.
83      * @uml.property name="screenSize"
84      */

85     public int getScreenSize() {
86         return screenSize;
87     }
88     
89     /**
90      * @param screenSize The screenSize to set.
91      * @uml.property name="screenSize"
92      */

93     public void setScreenSize(int screenSize) {
94         this.screenSize = screenSize;
95     }
96     
97     public void setDefault() {
98         this.maxFragments = DEFAULT_MAXFRAGMENTS;
99         this.representation = DEFAULT_REPRESENTATION;
100         this.screenSize = DEFAULT_SCREENSIZE;
101     }
102     
103     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
104         username = "";
105         maxFragments = 0;
106         representation = "";
107         screenSize = 0;
108     }
109 }
110
Popular Tags