@Override public boolean applyCriterion(Criterion criterion) { if (criterion instanceof PropertyCriterion) { PropertyCriterion prop = (PropertyCriterion) criterion; if (prop.getProperty() == this.property) { if (property == FilterProperty.DONATION_IS_ANON) { if (prop.getRelationalOperator() == RelationalOperator.NOT_NULL) { this.checkBox.setSelected(false); } else { this.checkBox.setSelected(true); } } else { this.checkBox.setSelected(prop.getBoolValue()); } return true; } } return false; }
@Override public Criterion createCriterion() throws InvalidInputException { PropertyCriterion crit = new PropertyCriterion(); crit.setProperty(property); if (property == FilterProperty.DONATION_IS_ANON) { if (checkBox.isSelected()) { crit.setRelationalOperator(RelationalOperator.IS_NULL); } else { crit.setRelationalOperator(RelationalOperator.NOT_NULL); } } else { crit.setRelationalOperator(RelationalOperator.EQUALS); crit.setBoolValue(checkBox.isSelected()); } return crit; }