Class StringFilter

All Implemented Interfaces:
PointerInterface

public class StringFilter extends Filter
`GtkStringFilter` determines whether to include items by comparing
strings to a fixed search term.

The strings are obtained from the items by evaluating a `GtkExpression`
set with [method@Gtk.StringFilter.set_expression], and they are
compared against a search term set with [method@Gtk.StringFilter.set_search].

`GtkStringFilter` has several different modes of comparison - it
can match the whole string, just a prefix, or any substring. Use
[method@Gtk.StringFilter.set_match_mode] choose a mode.

It is also possible to make case-insensitive comparisons, with
[method@Gtk.StringFilter.set_ignore_case].

https://docs.gtk.org/gtk4/class.StringFilter.html

  • Constructor Details

    • StringFilter

      public StringFilter(PointerContainer pointer)
    • StringFilter

      public StringFilter(@Nullable Expression expression)
      Creates a new string filter.

      You will want to set up the filter by providing a string to search for
      and by providing a property to look up on the item.
      Parameters:
      expression - The expression to evaluate
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getExpression

      public Expression getExpression()
      Gets the expression that the string filter uses to
      obtain strings from items.
      Returns:
      a `GtkExpression`
    • getIgnoreCase

      public boolean getIgnoreCase()
      Returns whether the filter ignores case differences.
      Returns:
      %TRUE if the filter ignores case
    • getMatchMode

      public int getMatchMode()
      Returns the match mode that the filter is using.
      Returns:
      the match mode of the filter
    • getSearch

      public Str getSearch()
      Gets the search term.
      Returns:
      The search term
    • setExpression

      public void setExpression(@Nullable Expression expression)
      Sets the expression that the string filter uses to
      obtain strings from items.

      The expression must have a value type of %G_TYPE_STRING.
      Parameters:
      expression - a `GtkExpression`
    • setIgnoreCase

      public void setIgnoreCase(boolean ignore_case)
      Sets whether the filter ignores case differences.
      Parameters:
      ignore_case - %TRUE to ignore case
    • setMatchMode

      public void setMatchMode(int mode)
      Sets the match mode for the filter.
      Parameters:
      mode - the new match mode
    • setSearch

      public void setSearch(@Nullable Str search)
      Sets the string to search for.
      Parameters:
      search - The string to search for or %NULL to clear the search
    • setSearch

      public void setSearch(String search)
      Sets the string to search for.
      Parameters:
      search - The string to search for or %NULL to clear the search
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()