Class TextBasedFilter<X>

java.lang.Object
gg.xp.xivsupport.gui.tables.filters.TextBasedFilter<X>
All Implemented Interfaces:
VisualFilter<X>
Direct Known Subclasses:
ActLineFilter, EventAbilityOrBuffFilter, EventClassFilterFilter, IdOrNameFilter, SystemLogLoggerNameFilter, SystemLogTextFilter, SystemLogThreadFilter

public class TextBasedFilter<X> extends Object implements VisualFilter<X>
  • Field Details

    • textBox

      protected final JTextField textBox
    • filterUpdatedCallback

      protected final Runnable filterUpdatedCallback
    • textExtractor

      protected final Function<X,String> textExtractor
    • originalBackground

      protected final Color originalBackground
    • currentFilter

      protected volatile Predicate<X> currentFilter
    • validationError

      protected boolean validationError
    • fieldLabel

      protected final String fieldLabel
    • ignoreCase

      protected static final boolean ignoreCase
      See Also:
    • invalidBackground

      protected final Color invalidBackground
  • Constructor Details

  • Method Details

    • boxToolTip

      protected String boxToolTip()
    • getFilterForInput

      @Nullable protected @Nullable Predicate<X> getFilterForInput(@NotNull @NotNull String input)
    • preFilter

      protected boolean preFilter(X item)
      Meant to be overridden. Pre-filter items in a smart way. Basically, allow this filter to specify whether it actually cares about a particular instance. If there is a filter set, then any instance that returns false when passed into this will fail automatically. If there is no filter set, everything will pass.

      If there is no filter whatsoever, let everything pass.

      If there is any filter, then apply this pre-filter.

      Parameters:
      item - The instance to filter
      Returns:
      whether to let the instance proceed to the main filter
    • passesFilter

      public boolean passesFilter(X item)
      Description copied from interface: VisualFilter
      Whether it passes the filter
      Specified by:
      passesFilter in interface VisualFilter<X>
      Parameters:
      item - The instance to filter
      Returns:
      Whether it passed
    • getComponent

      public Component getComponent()
      Description copied from interface: VisualFilter
      What to visually display
      Specified by:
      getComponent in interface VisualFilter<X>
      Returns:
      a component to display