Home | History | Annotate | Download | only in table
      1 package autotest.common.table;
      2 
      3 import com.google.gwt.json.client.JSONBoolean;
      4 import com.google.gwt.json.client.JSONObject;
      5 
      6 public class BooleanFilter extends ListFilter {
      7     private static final String[] choices = {"Yes", "No"};
      8 
      9     public BooleanFilter(String fieldName) {
     10         super(fieldName);
     11         setChoices(choices);
     12     }
     13 
     14     @Override
     15     public void addParams(JSONObject params) {
     16         String selected = getSelectedText();
     17         params.put(fieldName, JSONBoolean.getInstance(selected.equals("Yes")));
     18     }
     19 
     20     public boolean isSelected() {
     21         return getSelectedText().equals("Yes");
     22     }
     23 }
     24