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); if (matchName != null && matcher.match(matchName)) return true; return hasUnfilteredChild(treeViewer, element); }
public boolean selectTreePath(Viewer viewer, TreePath parentPath, Object element) { // Avoid endless loops, see https://bugs.eclipse.org/395202 : // Cut off children of elements that are shown repeatedly. for (int i= 0; i < parentPath.getSegmentCount() - 1; i++) { if (element.equals(parentPath.getSegment(i))) { return false; } } JavaElementPrefixPatternMatcher 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.matches(matchName)) return true; return hasUnfilteredChild(treeViewer, parentPath, element); }
public boolean selectTreePath(Viewer viewer, TreePath parentPath, Object element) { // Avoid endless loops, see https://bugs.eclipse.org/395202 : // Cut off children of elements that are shown repeatedly. for (int i= 0; i < parentPath.getSegmentCount() - 1; i++) { if (element.equals(parentPath.getSegment(i))) { return false; } } JavaElementPrefixPatternMatcher 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.matches(matchName)) return true; return hasUnfilteredChild(treeViewer, parentPath, element); }