01: package tijmp.actions;
02:
03: import java.awt.event.ActionEvent;
04: import tijmp.filter.AndFilter;
05: import tijmp.filter.ExactFilter;
06: import tijmp.filter.Filter;
07: import tijmp.filter.NotFilter;
08: import tijmp.ui.FilterConfig;
09: import tijmp.ui.Translator;
10:
11: /** A class that filters out one specific class.
12: */
13: public class FilterOutClass extends FilterAction {
14: private Class<?> clz;
15:
16: public FilterOutClass(FilterConfig fc, Class<?> clz) {
17: super ("Filter out " + Translator.translate(clz), fc);
18: this .clz = clz;
19: }
20:
21: public void actionPerformed(ActionEvent e) {
22: FilterConfig fc = getFilterConfig();
23: Filter f = fc.getFilter();
24: ExactFilter rf = new ExactFilter(clz);
25: NotFilter nf = new NotFilter(rf);
26: AndFilter af = new AndFilter(f, nf);
27: fc.setFilter(af);
28: }
29: }
|