Java Reference
In-Depth Information
13.2.1
Creating custom ToDo list items
IDEA lets you take the ToDo concept a step further by adjusting its ToDo search
pattern and defining your own. For example, you may need to embed questions in
your comments, and keep track of those questions in the code. You can configure
IDEA 's ToDo mechanism to be aware of any pattern; you can even give a unique
pattern its own icon. This pattern and its icon are specified in the TODO section of
the IDE Settings, as shown in figure 13.5. By default, only the single pattern for
matching ToDo items is present, but you can easily add additional patterns.
You specify each pattern using a regular expression , a type of shorthand for speci-
fying complex pattern matches. IDEA uses the regular expression library included
with JDK 1.4 for its pattern matching both here and in document searching and
replacing. Refer to the JDK 1.4 JavaDoc for details on creating regular expres-
sions. Along with the pattern itself, each entry also specifies an icon and its case
sensitivity. When you create or edit an entry, you can specify these options. The
icon is used by the entry in the TODO window. Unfortunately, there are only three
icons to pick from, but you can reuse icons across several patterns if you wish.
In one respect, saying that IDEA has ToDo support is a misnomer. IDEA
doesn't really have special support for ToDo comments; rather, it has a
facility for recognizing regular expressions in source code that carry sig-
nificant meaning. The IDE is also able to parse all its project source files,
and it supports defining, highlighting, managing, and navigating to any
instance of those regular expressions. The expression ToDo just happens
to be commonly used and is of most immediate use to IDEA 's user base.
NOTE
Figure 13.5
The TODO settings let you
create your own entries.
 
 
 
 
 
Search WWH ::




Custom Search