Java Reference
In-Depth Information
13.4.3
Reacting to the results of external tools
Some external tools provide you with information, in which case the output
from the tool needs to be captured and displayed. Some tools, however, respond
with detailed output that references specific files, lines, and even columns in
your source tree: for example, an external pre- or post-process code analyzer.
Some even alter the source code they used as input or generate new source code
from metadata files. IDEA has facilities for intelligently integrating with each of
these situations.
Opening a console
If the external application you're running displays output that you wish to view,
enable the Open console option in the tool's settings. This option tells IDEA to
open a message window to display the results of executing the program. This out-
put window works similarly to the output from running a Java application through
IDEA . If there are any problems, such as bad arguments or an invalid pathname,
these are also displayed in the output window, making it a useful option to enable
when debugging your settings. If your application doesn't produce any output, or
launches its own interface, you can leave this option deselected.
Using output filters to link program output
Many Java-related programs you run through the external tools feature generate
output messages that reference a file in your source tree. For example, a program
may reference an error in a particular source file. Through the use of output fil-
ters, you can train IDEA to interpret these types of messages, allowing it to hotlink
the messages with the editor just as it does when you encounter compilation
errors when building your project. You do this by defining one or more output fil-
ters for your tool using regular expressions.
Begin by clicking the Output Filters button in the tool editor to bring up the
current list of output filters. You can add as many filters as you'd like, but only the
first matching filter for each line will be used. You should design your filters to be
as unambiguous as possible. You can use the buttons in the Output Filters win-
dow to reorder and edit items in the list; click Add to define a new one.
When requested, specify a name and description for the filter. The most
important part, however, is creating the regular expression that identifies the
linkable reference in the program's output. In these regular expressions, you
embed placeholder variables to identify key components of the output:
 
 
 
 
 
 
 
Search WWH ::




Custom Search