Package org.fife.ui.rsyntaxtextarea
Interface OccurrenceMarker
- All Known Implementing Classes:
DefaultOccurrenceMarker
,HtmlOccurrenceMarker
,XmlOccurrenceMarker
public interface OccurrenceMarker
An
OccurrenceMarker
is called when the caret stops moving after
a short period. If the current TokenMaker
returns an instance of
this class, it is told to mark all occurrences of the identifier at the
caret position.- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptiongetTokenToMark
(RSyntaxTextArea textArea) Returns the token to mark occurrences, of, provided it matches the criteria put forth byisValidType(RSyntaxTextArea, Token)
.boolean
isValidType
(RSyntaxTextArea textArea, Token t) Returns whether the specified token is a type that we can do a "mark occurrences" of.void
markOccurrences
(RSyntaxDocument doc, Token t, RSyntaxTextAreaHighlighter h, SmartHighlightPainter p) Called when occurrences of a token should be marked.
-
Method Details
-
getTokenToMark
Returns the token to mark occurrences, of, provided it matches the criteria put forth byisValidType(RSyntaxTextArea, Token)
. For most languages, this method should return the token at the caret position.- Parameters:
textArea
- The text area.- Returns:
- The token to (possibly) mark occurrences of, or
null
if none.
-
isValidType
Returns whether the specified token is a type that we can do a "mark occurrences" of. Typically, this will delegate toRSyntaxTextArea.getMarkOccurrencesOfTokenType(int)
.- Parameters:
textArea
- The text area.t
- The token.- Returns:
- Whether we should mark all occurrences of this token.
-
markOccurrences
void markOccurrences(RSyntaxDocument doc, Token t, RSyntaxTextAreaHighlighter h, SmartHighlightPainter p) Called when occurrences of a token should be marked.- Parameters:
doc
- The document.t
- The document whose relevant occurrences should be marked.h
- The highlighter to add the highlights to.p
- The painter for the highlights.
-