blob: 84ac40a874857189f2b4c5c9014cd017bf88f5f5 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<title>Stand-alone external tools</title>
</HEAD>
<BODY BGCOLOR="#ffffff">
<h3>Stand-alone external tools</h3>
<P CLASS="Para">For the ultimate in external tool flexibility, create a 'stand-alone'
external tool launch configuration. This is similar to the project builder launch
configurations discussed in the last section, except that it need have nothing
to do with project building, and you can explicitly run it whenever you choose.
Suppose you wanted to have a way to quickly see the contents of a .jar file
in your workspace using the jar utility. </P>
<ol>
<li>Select some .jar file in your workspace.</li>
<li>Select <b>Run &gt; External Tools &gt; Open External Tools Dialog...</b> from the workbench
toolbar.<br>
<img src="../images/Image616_et_dropdown.png" alt="External tools drop-down menu" border="0" >
</li>
<li>Select <b>Program</b> in the tree, then click <b>New</b>.<br>
<img src="../images/Image617_jar_inspector.png" alt="External tools dialog for jar inspector script" border="0" >
</li>
<li>Name the launch configuration 'jar inspector'.</li>
<li>Use the first <b>Browse File System...</b> button to locate the jar executable.</li>
<li>In the <b>Arguments</b> field, type '-tvf' and a space, then click <b>Variables...</b>.</li>
<li>In the Select Variable dialog, you will see a number of variables you can
pass as arguments to the program specified in Location. Select <b>resource_loc</b>
and click <b>OK</b>. </li>
<li>When this buildfile is run, the absolute path of the resource selected in
the workbench will be passed to the jar utility in the position specified.
</li>
<li>Click <b>Run</b>.</li>
<li>Notice that the buildfile sends the jar utility output to the Console view.</li>
<li>Select a different .jar file in your workspace.</li>
<li>Click the External Tools button in the toolbar. Notice the contents of this
jar are sent to the Console view as well. Now you have a quick and easy way
to see the output of the jar utility for any .jar file in your workspace.</li>
</ol>
<p>This example has only scratched the surface of what you can do with external
tools. The important things to remember are that you can create an external
tool for anything you can run on your system, and that you can pass arguments
to the external tool related to the current workbench selection. In many cases,
this allows you to loosely integrate tools that do not have corresponding Eclipse
plug-ins. </p>
</BODY>
</HTML>