Java Reference
In-Depth Information
Table 12.3
General Colors & Fonts properties that apply to all files (continued)
Property name
What it controls
Folded text
Text representing a block of folded code
Folding outline
Code folding controls, if enabled
Selected folding outline
Currently selected code-folding control
Added lines
Color used in the gutter to indicate added lines, if using a VCS
Modified lines
Color used in the gutter to indicate changed lines, if using a VCS
Search result
Matching terms for search operations and refactorings
Search result (write access)
Write matches found by highlight usages in the file
Text search result
Color used to highlight the results of a text search in the file
Template variable
Color of template variables in live templates and file templates
Configuring Java properties
The Java tab is used to configure the color scheme for Java code, including JSP
scriptlets (this is the dialog shown in figure 12.4). If you review the list of color
scheme properties in table 12.4, you'll notice a lot more options than constants
and keywords. A number of properties are dedicated to error conditions, warn-
ings, and scoping. These options make it possible to use syntax highlighting as a
means for spotting errors not only in syntax, but in logic as well.
Let's illustrate this with a scenario we've experienced repeatedly. Unused sym-
bols are shown in their own color. This indicates that although a symbol (such as
an instance variable) is syntactically correct, it isn't referenced anywhere. When
you see an unused variable, you should be suspicious. Is it an obsolete reference?
Did you forget to implement the code that uses it? Did you use the wrong variable
name somewhere else? Because IDEA 's color highlighting is aware of syntax,
scope and references, it can be a valuable tool for catching bugs early.
Table 12.4
The Colors & Fonts properties that apply when editing a Java source file
Property name
What it controls
Keyword
Java keywords, such as public , class , return
Number
Numeric constant values, such as 12
continued on next page
 
 
 
Search WWH ::




Custom Search