1 23 package org.mdarad.framework.util.struts.criteria; 24 25 import java.util.Collection ; 26 import java.util.Locale ; 27 28 import org.mdarad.framework.expr.Criterion; 29 import org.mdarad.framework.expr.OperatorTypes; 30 31 38 public class ListCriterion extends FormCriterion { 39 40 51 public ListCriterion(String name, Class associatedEntity, CriterionProperty property, String bundleName, Locale locale) { 52 super(name, associatedEntity, property, bundleName, locale); 53 } 54 55 63 public ListCriterion(ListCriterion criterion) { 64 super(criterion); 65 setList(criterion.getList()); 66 } 67 68 74 public void setPropertyValue(String value) { 75 if (value != null) { 76 setValue(value); 77 } 78 } 79 80 86 public Class getObjectType() { 87 return String .class; 88 } 89 90 97 public Criterion getExprCriterion() { 98 Criterion crit = new Criterion(getAssociatedEntity(), 99 getProperty().getName(), 100 OperatorTypes.EQUAL, 101 getValue()); 102 103 return crit; 104 } 105 106 110 private Collection criterionElements; 111 112 117 public void addCriterionElement(CriterionListElement element) { 118 if (element != null) { 119 criterionElements.add(element); 120 } 121 } 122 123 128 public Collection getList() { 129 return criterionElements; 130 } 131 132 139 public void setList(Collection list) { 140 this.criterionElements = list; 141 } 142 143 148 public CriterionFormPattern getFormPattern() { 149 return CriterionFormPatterns.NO_OPERATOR_LIST; 150 } 151 152 156 private String onChangeAction = ""; 157 158 public String getOnChangeAction() { 159 return onChangeAction; 160 } 161 162 public void setOnChangeAction(String onChangeAction) { 163 this.onChangeAction = onChangeAction; 164 } 165 } | Popular Tags |