Class EndNodeTextFilter

  • All Implemented Interfaces:
    IFilterListener

    public class EndNodeTextFilter
    extends org.eclipse.jface.viewers.ViewerFilter
    implements IFilterListener
    An end-node text filter for Viewers used by the search engine.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      Constructor Description
      EndNodeTextFilter()
      Creates the filter, non-initialized.
      EndNodeTextFilter​(org.eclipse.jface.viewers.StructuredViewer viewer, IFilter filterComponent)
      Creates the filter for the viewer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addUnfiltered​(DesignerProp... props)
      Adds a DesignerProp extending class or a class that will never be filtered.
      void addUnfiltered​(GProp<?>... props)
      Adds a DesignerProp extending class or a class that will never be filtered.
      void addUnfiltered​(java.lang.Class<?>... clazz)
      Adds a DesignerProp extending class or a class that will never be filtered.
      BoldFontStyler getBoldFontStyler()
      Gets the bold font styler.
      IFilter getFilterComponent()
      Gets the filter component.
      java.lang.String getFilterText()
      Gets the search text filter for the label provider.
      void initialize​(org.eclipse.jface.viewers.StructuredViewer viewer, IFilter filterComponent)
      Initializes after creation from empty constructor.
      static boolean isElementOmitted​(java.lang.Class<?> clazz)
      Checks if an element class is omitted
      static boolean isElementOmitted​(java.lang.Object element)
      Checks if an element is omitted filtering for performance reasons, i.e.
      void onFilter​(java.lang.String text)
      Notification that a new text has been set, null for none, never empty string.
      boolean select​(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parentElement, java.lang.Object element)
      Returns whether the given element makes it through this filter.
      void setFilterColumn​(int column)
      Sets the filtering column for the text for table viewers or tree table viewers.
      • Methods inherited from class org.eclipse.jface.viewers.ViewerFilter

        filter, filter, isFilterProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EndNodeTextFilter

        public EndNodeTextFilter()
        Creates the filter, non-initialized. Call initialize(viewer,filterComponent) to initialize.
      • EndNodeTextFilter

        public EndNodeTextFilter​(org.eclipse.jface.viewers.StructuredViewer viewer,
                                 IFilter filterComponent)
        Creates the filter for the viewer.
        Parameters:
        viewer - The common viewer.
        filterComponent - The filter component.
    • Method Detail

      • isElementOmitted

        public static boolean isElementOmitted​(java.lang.Object element)
        Checks if an element is omitted filtering for performance reasons, i.e. typically Java classpath, etc. null value also returns true.
      • isElementOmitted

        public static boolean isElementOmitted​(java.lang.Class<?> clazz)
        Checks if an element class is omitted
      • setFilterColumn

        public void setFilterColumn​(int column)
        Sets the filtering column for the text for table viewers or tree table viewers.
      • initialize

        public void initialize​(org.eclipse.jface.viewers.StructuredViewer viewer,
                               IFilter filterComponent)
        Initializes after creation from empty constructor.
        Parameters:
        viewer - The common viewer.
        filterComponent - The filter component.
      • getFilterComponent

        public IFilter getFilterComponent()
        Gets the filter component.
        Returns:
        The filter component, or null for none.
      • addUnfiltered

        public void addUnfiltered​(java.lang.Class<?>... clazz)
        Adds a DesignerProp extending class or a class that will never be filtered.
        Parameters:
        clazz - The list of classes that will not be filtered.
      • addUnfiltered

        public void addUnfiltered​(GProp<?>... props)
        Adds a DesignerProp extending class or a class that will never be filtered.
        Parameters:
        props - The list of properties that will not be filtered.
      • addUnfiltered

        public void addUnfiltered​(DesignerProp... props)
        Adds a DesignerProp extending class or a class that will never be filtered.
        Parameters:
        props - The list of properties that will not be filtered.
      • onFilter

        public void onFilter​(java.lang.String text)
        Notification that a new text has been set, null for none, never empty string.
        Specified by:
        onFilter in interface IFilterListener
        Parameters:
        text - The filter text to apply, null for none (never empty string).
      • getFilterText

        public java.lang.String getFilterText()
        Gets the search text filter for the label provider.
        Returns:
        The filter text, or null for none, never empty string.
      • getBoldFontStyler

        public BoldFontStyler getBoldFontStyler()
        Gets the bold font styler.
      • select

        public boolean select​(org.eclipse.jface.viewers.Viewer viewer,
                              java.lang.Object parentElement,
                              java.lang.Object element)
        Returns whether the given element makes it through this filter.
        Specified by:
        select in class org.eclipse.jface.viewers.ViewerFilter
        Parameters:
        viewer - The viewer.
        parentElement - The parent element.
        element - The element.
        Returns:
        true if element is included in the filtered set, and false if excluded.