Class FilteringOutlinePopup.ElementMatcher

java.lang.Object
org.eclipse.handly.ui.quickoutline.FilteringOutlinePopup.ElementMatcher
All Implemented Interfaces:
Predicate<Object>
Enclosing class:
FilteringOutlinePopup

protected class FilteringOutlinePopup.ElementMatcher extends Object implements Predicate<Object>
A pattern-based element matcher for the outline popup. Passes the text (by default, the label string) obtained for the given outline element to the underlying string matcher.
  • Constructor Details

    • ElementMatcher

      public ElementMatcher(Predicate<String> stringMatcher)
      Creates a new element matcher based on the given string matcher.
      Parameters:
      stringMatcher - not null
  • Method Details

    • test

      public final boolean test(Object element)
      Specified by:
      test in interface Predicate<Object>
    • getText

      protected String getText(Object element)
      Returns the text for the given outline element.

      Default implementation returns the label string obtained from the tree viewer's label provider.

      Parameters:
      element - the outline element (never null)
      Returns:
      the text for the given outline element, or null if no text can be obtained