[FNR] Filters. Bug and inheritance problem.
Hi.
I have found a bug in Date Filter (On same date comparison doesn't work as expected)
In file:
DateFilter.java:
Replace: if (afterItem.isChecked() && onMenu.getDate() != null) {
by: if (onItem.isChecked() && onMenu.getDate() != null) {
Moreover:
Is it possible to modify method validateModel:
public class DateFilter extends Filter {
....
@Override
public boolean validateModel(ModelData model) {
Date d = model.get(dataIndex);
..
}
...
}
by something like:
public class DateFilter extends Filter {
....
public Object getValue(ModelData model) {
return model.get(dataIndex);
}
@Override
public boolean validateModel(ModelData model) {
Date d = getValue();
..
}
...
}
My model doesn't contain Date but a Type witch can return a Date.
With this solution i can write a class witch extend DateFilter like:
public class MyOwnTypeFilter extends DateFilter {
public Object getValue(ModelData model) {
MyOwnType obj = (MyOwnType)model.get(dataIndex);
return (Date) obj.getMyDate();
}
}
Please modify all object witch inherit from Filter like this one.
Without this, we must duplicate lot of your code.
Thanx