/* * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ public boolean select(Viewer viewer, Object parentElement, Object element) { StringMatcher matcher = getMatcher(); if (matcher == null || !(viewer instanceof TreeViewer)) return true; TreeViewer treeViewer = (TreeViewer) viewer; String matchName = ((ILabelProvider) treeViewer.getLabelProvider()).getText(element); matchName = TextProcessor.deprocess(matchName); if (matchName != null && matcher.match(matchName)) return true; return hasUnfilteredChild(treeViewer, element); }
@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; }
/** * Answers whether the given String matches the pattern. * * @param string the String to test * @return whether the string matches the pattern */ protected boolean match(String string) { return matcher.match(string); }