public class TreeSearchable extends AbstractSearchable
AbstractSearchable.SearchResult| Modifier and Type | Field and Description |
|---|---|
protected JXTree |
tree |
lastSearchResult, MATCH_HIGHLIGHTER| Constructor and Description |
|---|
TreeSearchable(JXTree tree)
Instantiates a Searchable for the given JTree.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHighlighter(Highlighter highlighter)
Adds the highlighter to the target.
|
protected AbstractSearchable.SearchResult |
findExtendedMatch(Pattern pattern,
int row)
Matches the cell at row/lastFoundColumn against the pattern.
|
protected void |
findMatchAndUpdateState(Pattern pattern,
int startRow,
boolean backwards)
Loops through the searchable until a match is found or the
end is reached.
|
protected AbstractSearchable.SearchResult |
findMatchAt(Pattern pattern,
int row)
Matches the cell content at row/col against the given Pattern.
|
protected Highlighter[] |
getHighlighters()
Returns the highlighters registered on the search target.
|
protected int |
getSize()
Returns the size of this searchable.
|
JXTree |
getTarget()
It's the responsibility of subclasses to covariant override.
|
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 void |
removeHighlighter(Highlighter searchHighlighter)
Removes the highlighter.
|
adjustStartPosition, convertColumnIndexToModel, createMatchHighlighter, createMatchPredicate, createSearchResult, doSearch, ensureInsertedSearchHighlighters, getConfiguredMatchHighlighter, getMatchHighlighter, hasMatch, isEmpty, isEqualPattern, isEqualStartIndex, isTrivialNoMatch, isValidIndex, markByHighlighter, moveStartPosition, search, search, search, search, search, search, setMatchHighlighter, updateStateprotected JXTree tree
public TreeSearchable(JXTree tree)
tree - the JTree to search, must not be null.protected void findMatchAndUpdateState(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(Pattern pattern, int row)
AbstractSearchablefindExtendedMatch in class AbstractSearchablepattern - Pattern that we will try to matchrow - position at which we will get the value to match with the provided PatternAbstractSearchable.SearchResultprotected AbstractSearchable.SearchResult findMatchAt(Pattern pattern, int row)
pattern - row - a valid row index in view coordinates a valid column index in
view coordinatesSearchResult if matching or null if
no matchingprotected int getSize()
AbstractSearchablegetSize in class AbstractSearchablepublic JXTree getTarget()
getTarget in class AbstractSearchableprotected void moveMatchMarker()
moveMatchMarker in class AbstractSearchableprotected void moveMatchBySelection()
protected void moveMatchByHighlighter()
protected void removeHighlighter(Highlighter searchHighlighter)
AbstractSearchableremoveHighlighter in class AbstractSearchablesearchHighlighter - protected Highlighter[] getHighlighters()
AbstractSearchablegetHighlighters in class AbstractSearchableprotected void addHighlighter(Highlighter highlighter)
AbstractSearchableaddHighlighter in class AbstractSearchablehighlighter - Copyright © 2017. All Rights Reserved.