Package org.eclipse.handly.ui.quickoutline

# 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 Summary

  Constructors
  Constructor
  Description
  `ElementMatcher(Predicate<String> stringMatcher)`
  Creates a new element matcher based on the given string matcher.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `getText(Object element)`
  Returns the text for the given outline element.
  `final boolean`
  `test(Object element)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Predicate

  `and, negate, or`

- ## 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