1 package org.contineo.core.config; 2 3 import javax.servlet.http.HttpServletRequest ; 4 import org.apache.struts.action.ActionMapping; 5 import org.apache.struts.validator.ValidatorForm; 6 7 11 public class SearchSettings extends ValidatorForm { 12 13 private static final long serialVersionUID = 1L; 14 private String username; 15 private int maxFragments; 16 private String 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 DEFAULT_REPRESENTATION = "text"; 22 23 26 public SearchSettings() { 27 username = ""; 28 maxFragments = 0; 29 representation = ""; 30 screenSize = 0; 31 } 32 33 37 public int getMaxFragments() { 38 return maxFragments; 39 } 40 41 45 public void setMaxFragments(int maxFragments) { 46 this.maxFragments = maxFragments; 47 } 48 49 53 public String getRepresentation() { 54 return representation; 55 } 56 57 61 public void setRepresentation(String representation) { 62 this.representation = representation; 63 } 64 65 69 public String getUsername() { 70 return username; 71 } 72 73 77 public void setUsername(String username) { 78 this.username = username; 79 } 80 81 85 public int getScreenSize() { 86 return screenSize; 87 } 88 89 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 request) { 104 username = ""; 105 maxFragments = 0; 106 representation = ""; 107 screenSize = 0; 108 } 109 } 110 | Popular Tags |