Class FilteringOutlinePopup.ElementMatcher

  • All Implemented Interfaces:
    java.util.function.Predicate<java.lang.Object>
    Enclosing class:
    FilteringOutlinePopup

    protected class FilteringOutlinePopup.ElementMatcher
    extends java.lang.Object
    implements java.util.function.Predicate<java.lang.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​(java.util.function.Predicate<java.lang.String> stringMatcher)
      Creates a new element matcher based on the given string matcher.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getText​(java.lang.Object element)
      Returns the text for the given outline element.
      boolean test​(java.lang.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 Detail

      • ElementMatcher

        public ElementMatcher​(java.util.function.Predicate<java.lang.String> stringMatcher)
        Creates a new element matcher based on the given string matcher.
        Parameters:
        stringMatcher - not null
    • Method Detail

      • test

        public final boolean test​(java.lang.Object element)
        Specified by:
        test in interface java.util.function.Predicate<java.lang.Object>
      • getText

        protected java.lang.String getText​(java.lang.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