public class TableSearchable extends AbstractSearchable
AbstractSearchable.SearchResult| Modifier and Type | Field and Description |
|---|---|
protected JXTable |
table |
lastSearchResult, MATCH_HIGHLIGHTER, NO_MATCH| Constructor and Description |
|---|
TableSearchable(JXTable table) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHighlighter(Highlighter highlighter) |
protected int |
adjustStartPosition(int startIndex,
boolean backwards)
Called if startIndex is different from last search, reset the column
to -1 and make sure a backwards/forwards search starts at last/first
row, respectively.
|
protected int |
convertColumnIndexToModel(int viewColumn)
Converts and returns the given column index from view coordinates to model
coordinates.
|
protected AbstractSearchable.SearchResult |
findExtendedMatch(java.util.regex.Pattern pattern,
int row)
called if sameRowIndex && !hasEqualRegEx.
|
protected void |
findMatchAndUpdateState(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.SearchResult |
findMatchAt(java.util.regex.Pattern pattern,
int row,
int column)
Matches the cell content at row/col against the given Pattern.
|
protected Highlighter[] |
getHighlighters() |
protected int |
getSize()
returns the size of this searchable.
|
JXTable |
getTarget()
It's the responsibility of subclasses to covariant override.
|
protected boolean |
isEqualStartIndex(int startIndex)
Checks if the startIndex is a candidate for trying a re-match.
|
protected void |
moveMatchByHighlighter()
use and move the match highlighter.
|
protected void |
moveMatchBySelection() |
protected void |
moveMatchMarker()
Moves the match marker according to current found state.
|
protected int |
moveStartPosition(int startRow,
boolean backwards)
Moves the internal start for matching as appropriate and returns the
new startIndex to use.
|
protected void |
removeHighlighter(Highlighter searchHighlighter) |
createMatchHighlighter, createMatchPredicate, createSearchResult, doSearch, ensureInsertedSearchHighlighters, getConfiguredMatchHighlighter, getMatchHighlighter, hasMatch, isEmpty, isEqualPattern, isTrivialNoMatch, isValidIndex, markByHighlighter, search, search, search, search, search, search, setMatchHighlighter, updateStateprotected JXTable table
public TableSearchable(JXTable table)
table - protected void findMatchAndUpdateState(java.util.regex.Pattern pattern,
int startRow,
boolean backwards)
AbstractSearchablefindMatchAndUpdateState in class AbstractSearchablepattern - Pattern that 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 - true if we should perform search towards the beginningprotected AbstractSearchable.SearchResult findExtendedMatch(java.util.regex.Pattern pattern, int row)
findExtendedMatch in class AbstractSearchablepattern - row - SearchResult if matching or nullprotected AbstractSearchable.SearchResult findMatchAt(java.util.regex.Pattern pattern, int row, int column)
pattern - row - a valid row index in view coordinatescolumn - a valid column index in view coordinatesSearchResult if matching or nullprotected int adjustStartPosition(int startIndex,
boolean backwards)
adjustStartPosition in class AbstractSearchablestartIndex - backwards - startIndexprotected int moveStartPosition(int startRow,
boolean backwards)
moveStartPosition in class AbstractSearchablestartRow - backwards - protected boolean isEqualStartIndex(int startIndex)
isEqualStartIndex in class AbstractSearchablestartIndex - protected int getSize()
getSize in class AbstractSearchablepublic JXTable getTarget()
getTarget in class AbstractSearchableprotected void moveMatchByHighlighter()
protected int convertColumnIndexToModel(int viewColumn)
PENDING JW: this is only necessary because the SearchPredicate wants its highlight column in model coordinates. But code comments in the SearchPredicate seem to indicate that we probably want to revise that (legacy?).
convertColumnIndexToModel in class AbstractSearchableviewColumn - the column index in view coordinates, must be a valid index
in that system.protected void moveMatchBySelection()
protected void moveMatchMarker()
AbstractSearchablemoveMatchMarker in class AbstractSearchableprotected void removeHighlighter(Highlighter searchHighlighter)
removeHighlighter in class AbstractSearchablesearchHighlighter - protected Highlighter[] getHighlighters()
getHighlighters in class AbstractSearchableprotected void addHighlighter(Highlighter highlighter)
addHighlighter in class AbstractSearchablehighlighter -