1 16 package com.blandware.atleap.webapp.form.core; 17 18 import com.blandware.atleap.webapp.taglib.core.grid.util.FilterConditions; 19 import org.apache.struts.action.ActionMapping; 20 21 import javax.servlet.http.HttpServletRequest ; 22 import java.util.Collections ; 23 import java.util.HashMap ; 24 import java.util.Map ; 25 26 36 public class SetFilterForm extends BaseFilterForm { 37 38 protected String beanId = null; 39 protected String method = null; 40 protected String label = null; 41 protected String value = null; 42 protected String firstCondition = FilterConditions.FIELD_IN_SET; 43 protected Map selectedElements = Collections.synchronizedMap(new HashMap ()); 44 45 48 public SetFilterForm() { 49 } 50 51 56 public String getBeanId() { 57 return beanId; 58 } 59 60 65 public void setBeanId(String beanId) { 66 this.beanId = beanId; 67 } 68 69 74 public String getMethod() { 75 return method; 76 } 77 78 83 public void setMethod(String method) { 84 this.method = method; 85 } 86 87 92 public String getLabel() { 93 return label; 94 } 95 96 101 public void setLabel(String label) { 102 this.label = label; 103 } 104 105 110 public String getValue() { 111 return value; 112 } 113 114 119 public void setValue(String value) { 120 this.value = value; 121 } 122 123 128 public String getFirstCondition() { 129 return firstCondition; 130 } 131 132 137 public void setFirstCondition(String firstCondition) { 138 this.firstCondition = firstCondition; 139 } 140 141 147 public Object getElement(String key) { 148 if ( selectedElements.containsKey(key) ) { 149 return Boolean.TRUE; 150 } else { 151 return Boolean.FALSE; 152 } 153 } 154 155 161 public void setElement(String key, Object value) { 162 if ( log.isDebugEnabled() ) { 163 log.debug("Setting element: key=" + key); 164 } 165 selectedElements.put(key, value); 166 } 167 168 173 public Map getSelectedElements() { 174 return selectedElements; 175 } 176 177 182 public void setSelectedElements(Map selectedElements) { 183 this.selectedElements = selectedElements; 184 } 185 186 192 public void reset(ActionMapping mapping, HttpServletRequest request) { 193 super.reset(mapping, request); 194 this.firstCondition = FilterConditions.FIELD_IN_SET; 195 this.clearFilter = null; 196 this.selectedElements = Collections.synchronizedMap(new HashMap ()); 197 this.beanId = null; 198 this.method = null; 199 this.label = null; 200 this.value = null; 201 } 202 203 } | Popular Tags |