Class FilteringOutlinePopup.StringMatcher

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

protected static class FilteringOutlinePopup.StringMatcher extends Object implements Predicate<String>
A string pattern matcher that supports '*' and '?' wildcards.
  • Constructor Details

    • StringMatcher

      public StringMatcher(String pattern, boolean ignoreCase)
      Creates a new string matcher based on the given pattern. The pattern may contain '*' for zero or more characters and '?' for exactly one character.
      Parameters:
      pattern - the pattern string (not null)
      ignoreCase - whether case-insensitive matching is enabled
  • Method Details

    • test

      public final boolean test(String text)
      Specified by:
      test in interface Predicate<String>
    • translatePattern

      protected String translatePattern(String pattern)
      Translates the given pattern into a regular expression.

      This implementation always returns a regular expression that starts with '^'.

      Parameters:
      pattern - the pattern string (not null)
      Returns:
      the regular expression corresponding to the pattern (never null)