Package org.jdesktop.swingx.search
Class ListSearchable
- java.lang.Object
-
- org.jdesktop.swingx.search.AbstractSearchable
-
- org.jdesktop.swingx.search.ListSearchable
-
- All Implemented Interfaces:
Searchable
public class ListSearchable extends AbstractSearchable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jdesktop.swingx.search.AbstractSearchable
AbstractSearchable.SearchResult
-
-
Field Summary
Fields Modifier and Type Field Description protected JXListlist-
Fields inherited from class org.jdesktop.swingx.search.AbstractSearchable
lastSearchResult, MATCH_HIGHLIGHTER, NO_MATCH
-
-
Constructor Summary
Constructors Constructor Description ListSearchable(JXList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractSearchable.SearchResultfindExtendedMatch(java.util.regex.Pattern pattern, int row)called if sameRowIndex && !hasEqualRegEx.protected voidfindMatchAndUpdateState(java.util.regex.Pattern pattern, int startRow, boolean backwards)Loops through the searchable until a match is found or the end is reached.protected AbstractSearchable.SearchResultfindMatchAt(java.util.regex.Pattern pattern, int row)Matches the cell content at row/col against the given Pattern.protected intgetSize()returns the size of this searchable.protected booleanhasMatch(AbstractSearchable.SearchResult result)protected voidmoveMatchMarker()Moves the match marker according to current found state.-
Methods inherited from class org.jdesktop.swingx.search.AbstractSearchable
adjustStartPosition, createSearchResult, doSearch, isEmpty, isEqualPattern, isEqualStartIndex, isTrivialNoMatch, isValidIndex, moveStartPosition, search, search, search, search, search, search, updateState
-
-
-
-
Field Detail
-
list
protected JXList list
-
-
Constructor Detail
-
ListSearchable
public ListSearchable(JXList list)
-
-
Method Detail
-
findMatchAndUpdateState
protected void findMatchAndUpdateState(java.util.regex.Pattern pattern, int startRow, boolean backwards)Description copied from class:AbstractSearchableLoops through the searchable until a match is found or the end is reached. Updates internal search state.- Specified by:
findMatchAndUpdateStatein classAbstractSearchable- Parameters:
pattern-Patternthat we will try to locatestartRow- position in the document in the appropriate coordinates from which we will start search or -1 to start from the beginningbackwards-trueif we should perform search towards the beginning
-
findExtendedMatch
protected AbstractSearchable.SearchResult findExtendedMatch(java.util.regex.Pattern pattern, int row)
Description copied from class:AbstractSearchablecalled if sameRowIndex && !hasEqualRegEx. Matches the cell at row/lastFoundColumn against the pattern. PRE: lastFoundColumn valid.- Specified by:
findExtendedMatchin classAbstractSearchable- Parameters:
pattern-Patternthat we will try to matchrow- position at which we will get the value to match with the providedPattern- Returns:
- result of the match;
AbstractSearchable.SearchResult
-
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- Returns:
SearchResultif matched otherwise null
-
getSize
protected int getSize()
Description copied from class:AbstractSearchablereturns the size of this searchable.- Specified by:
getSizein classAbstractSearchable- Returns:
- size of this searchable
-
hasMatch
protected boolean hasMatch(AbstractSearchable.SearchResult result)
- Parameters:
result-- Returns:
trueif theresultcontains a match;falseotherwise
-
moveMatchMarker
protected void moveMatchMarker()
Description copied from class:AbstractSearchableMoves the match marker according to current found state.- Specified by:
moveMatchMarkerin classAbstractSearchable
-
-