001: /*
002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005:
006: package com.sun.portal.search.providers;
007:
008: import java.lang.*;
009: import java.io.*;
010: import java.util.*;
011:
012: import com.sun.portal.search.soif.*;
013: import com.sun.portal.search.demo.*;
014:
015: /**
016: * SearchEditForm is a helper bean for the search edit jsp.
017: * The class uses the bean reflection property and has accessor methods
018: * for its properties.
019: *
020: */
021: public class SearchEditFormBean implements Serializable {
022: Boolean categorySearch, defaultSearch;
023: String description, defaultMode;
024: Integer hits;
025: int viewHits;
026:
027: /**
028: * Sets the categorySearch property
029: * @param cs is the value for the categorySearch property
030: */
031: public void setCategorySearch(Boolean cs) {
032: this .categorySearch = cs;
033: }
034:
035: /**
036: * Sets the boolean defaultSearch property
037: * @param ds value for defaultSearch
038: */
039: public void setDefaultSearch(Boolean ds) {
040: this .defaultSearch = ds;
041: }
042:
043: /**
044: * Sets the Integer viewHits property
045: * @param viewhits value for viewHits
046: */
047: public void setHits(Integer viewhits) {
048: this .hits = viewhits;
049: }
050:
051: /**
052: * Sets the description property
053: * @param d is the value for description
054: */
055: public void setDescription(String d) {
056: this .description = d;
057: }
058:
059: /**
060: * Sets the default search mode property
061: * @param dd is the value for default Search mode
062: */
063: public void setDefaultMode(String dd) {
064: this .defaultMode = dd;
065: }
066:
067: /**
068: * Returns 'CHECKED' if the parameter is true and false otherwise
069: * @return 'CHECKED' if the parameter is true and empty string otherwise
070: */
071: public String booleanCheckBox(Boolean b) {
072: if (b.booleanValue())
073: return "CHECKED";
074: else
075: return "";
076: }
077:
078: /**
079: * Compares the parameter with the description property
080: * @return 'CHECKED' if equal and empty string if unequal
081: */
082: public String descCheckbox(String s) {
083: if (s.equals(description))
084: return "CHECKED";
085: else
086: return "";
087: }
088:
089: public String defaultModeSelection(String s) {
090: if (s.equals(defaultMode))
091: return "CHECKED";
092: else
093: return "";
094: }
095:
096: public String hitsSelection(int v) {
097: if (hits.intValue() == v)
098: return "SELECTED";
099: else
100: return "";
101: }
102:
103: }
|