@Override public boolean match(final String text) { if (super.match(text)) { return true; } else { for (Filter filter : operationFilters) { if (filter.getEnabled()) { StringMatcher stringMatcher = new StringMatcher(filter.getPattern(), false, false); if (stringMatcher.match(text)) { return true; } } } } return false; }
public void addOperationFilter(final Filter filter) { MenuItem[] items = filtersMenu.getItems(); int pos = 0; for (MenuItem item : items) { if (item == configureItem) { break; } pos++; } pos--; operationFilters.add(filter); final MenuItem item = new MenuItem(filtersMenu, SWT.CHECK, pos); item.setText(filter.getName()); item.setSelection(filter.getEnabled()); item.setData(filter); item.addSelectionListener(this); }