19 package org.turro.jpa.input;
21 import java.util.LinkedList;
22 import java.util.List;
23 import org.turro.string.Strings;
24 import org.turro.elephant.db.WhereClause;
25 import org.turro.i18n.I_;
26 import org.turro.jpa.Dao;
34 private Object[] parameters;
35 private List<String> defaultValues;
39 this.defaultValues = defaultValues;
43 this.parameters = parameters;
47 this.defaultValues = defaultValues;
51 public void populateList(String value, LinkedList list,
int nRows) {
52 if(Strings.isBlank(value)) value =
"";
53 addValues(list, defaultValues, value);
54 LinkedList tmp =
new LinkedList();
55 super.populateList(value, tmp, nRows);
56 addValues(list, tmp, value);
61 if(parameters !=
null) {
62 return I_.
format((String) value, parameters);
64 return I_.
get((String) value);
68 private void addValues(LinkedList list, List values, String search) {
69 if(values ==
null)
return;
70 for(Object obj : values) {
71 String s = (String) obj;
72 if(!list.contains(s) && Strings.findsIgnoreCase(s, search)) {
static String format(String msg, Object... arguments)
static String get(String msg)