01: package tijmp.actions;
02:
03: import java.awt.event.ActionEvent;
04: import tijmp.filter.AndFilter;
05: import tijmp.filter.Filter;
06: import tijmp.filter.NotFilter;
07: import tijmp.filter.RecursiveFilter;
08: import tijmp.ui.FilterConfig;
09:
10: /** A class that filters out a package and its sub packages
11: */
12: public class FilterOutPackage extends FilterAction {
13: private String pname;
14:
15: public FilterOutPackage(FilterConfig fc, String pname) {
16: super ("Filter out " + pname + " and sub packages", fc);
17: this .pname = pname;
18: }
19:
20: public void actionPerformed(ActionEvent e) {
21: FilterConfig fc = getFilterConfig();
22: Filter f = fc.getFilter();
23: RecursiveFilter rf = new RecursiveFilter(pname);
24: NotFilter nf = new NotFilter(rf);
25: AndFilter af = new AndFilter(f, nf);
26: fc.setFilter(af);
27: }
28: }
|