Hi, Karl,
You COULD get what you are looking for by just implementing a new
IParseModel (and setting it on the FilterSettings instance). The code
for the new parser model would look like:
package net.coderazzi.filters.examples.in_parser;
import net.coderazzi.filters.IParser;
import net.coderazzi.filters.gui.IFilterEditor;
import net.coderazzi.filters.gui.ParserModel;
import net.coderazzi.filters.parser.Parser;
import javax.swing.*;
import java.text.Format;
import java.text.ParseException;
import java.util.Comparator;
public class InParserModel extends ParserModel{
@Override
public IParser createParser(IFilterEditor editor) {
boolean ignoreCase = editor.isIgnoreCase();
Class cl = editor.getModelClass();
Format fmt = (cl == String.class) ? null : editor.getFormat();
Comparator cmp = (fmt == null) ? null : editor.getComparator();
return new Parser(fmt, cmp, getStringComparator(ignoreCase), ignoreCase,
editor.getModelIndex()){
@Override
public RowFilter parseText(String expression) throws
ParseException {
return super.parseText("*" + expression);
}
@Override
public InstantFilter parseInstantText(String expression)
throws ParseException {
return super.parseInstantText("*" + expression);
}
};
}
}
Now, even if this parser does what you need, you will lose the generic
functionality (for example, if a column has integers, you can use
normally a filter such as '> 34'). With the offered ParserModel, that
would stop working,
I will check if the library allows for an easy modification to include
your request,
Best regards,
Luis
> --
> You received this message because you are subscribed to the Google Groups
> "tablefilter-swing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
tablefilter-sw...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.