Package org.fife.ui.rsyntaxtextarea
Interface OccurrenceMarker
-
- All Known Implementing Classes:
HtmlOccurrenceMarker
,XmlOccurrenceMarker
public interface OccurrenceMarker
AnOccurrenceMarker
is called when the caret stops moving after a short period. If the currentTokenMaker
returns an instance of this class, it is told to mark all occurrences of the identifier at the caret position.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Token
getTokenToMark(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 Detail
-
getTokenToMark
Token getTokenToMark(RSyntaxTextArea textArea)
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
boolean isValidType(RSyntaxTextArea textArea, Token t)
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.
-
-