Class TreeSearchable

  • All Implemented Interfaces:
    Searchable

    public class TreeSearchable
    extends AbstractSearchable
    A searchable targetting the visible rows of a JXTree. PENDING: value to string conversion should behave as nextMatch (?) which uses the convertValueToString().
    • Field Detail

    • Constructor Detail

      • TreeSearchable

        public TreeSearchable​(JXTree tree)
        Parameters:
        tree -
    • Method Detail

      • findMatchAndUpdateState

        protected void findMatchAndUpdateState​(java.util.regex.Pattern pattern,
                                               int startRow,
                                               boolean backwards)
        Description copied from class: AbstractSearchable
        Loops through the searchable until a match is found or the end is reached. Updates internal search state.
        Specified by:
        findMatchAndUpdateState in class AbstractSearchable
        Parameters:
        pattern - Pattern that we will try to locate
        startRow - position in the document in the appropriate coordinates from which we will start search or -1 to start from the beginning
        backwards - true if we should perform search towards the beginning
      • findMatchAt

        protected AbstractSearchable.SearchResult findMatchAt​(java.util.regex.Pattern pattern,
                                                              int row)
        Matches the cell content at row/col against the given Pattern. Returns an appropriate SearchResult if matching or null if no matching
        Parameters:
        pattern -
        row - a valid row index in view coordinates a valid column index in view coordinates
        Returns:
        an appropriate SearchResult if matching or null if no matching
      • hasMatch

        protected boolean hasMatch​(AbstractSearchable.SearchResult result)
        Parameters:
        result -
        Returns:
        true if the result contains a match; false otherwise