Class TaskTagParser
java.lang.Object
org.fife.ui.rsyntaxtextarea.parser.AbstractParser
org.fife.ui.rsyntaxtextarea.parser.TaskTagParser
- All Implemented Interfaces:
Parser
Parser that identifies "task tags," such as "
TODO
",
"FIXME
", etc. in source code comments.- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A parser notice that signifies a task. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Color
private static final String
private DefaultParseResult
private Pattern
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the regular expression used to search for tasks.parse
(RSyntaxDocument doc, String style) Parses input from the specified document.void
setTaskPattern
(String pattern) Sets the pattern of task identifiers.Methods inherited from class org.fife.ui.rsyntaxtextarea.parser.AbstractParser
getHyperlinkListener, getImageBase, isEnabled, setEnabled, setHyperlinkListener
-
Field Details
-
result
-
DEFAULT_TASK_PATTERN
- See Also:
-
taskPattern
-
COLOR
-
-
Constructor Details
-
TaskTagParser
public TaskTagParser()Creates a new task parser. The default parser treats the following identifiers in comments as task definitions: "TODO
", "FIXME
", and "HACK
".
-
-
Method Details
-
getTaskPattern
Returns the regular expression used to search for tasks.- Returns:
- The regular expression. This may be
null
if no regular expression was specified (or an empty string was specified). - See Also:
-
parse
Description copied from interface:Parser
Parses input from the specified document.- Parameters:
doc
- The document to parse. This document is in a read lock, so it cannot be modified while parsing is occurring.style
- The language being rendered, such asSyntaxConstants.SYNTAX_STYLE_JAVA
.- Returns:
- An object describing the section of the document parsed and the
results. This is guaranteed to be non-
null
.
-
setTaskPattern
Sets the pattern of task identifiers. You will usually want this to be a list of words "or'ed" together, such as "TODO|FIXME|HACK|REMIND
".- Parameters:
pattern
- The pattern. A value ofnull
or an empty string effectively disables task parsing.- Throws:
PatternSyntaxException
- Ifpattern
is an invalid regular expression.- See Also:
-