blob: e505f8d81161749fab7a0308dcff8211b646a5d1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>
<HEAD>
<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>Running a plug-in</title>
</head>
<BODY BGCOLOR="#ffffff">
<h1>Running a plug-in</h1>
<p>As you develop your plug-in in the workspace, the incremental Java compiler
will compile your Java source code and place the <b> *.class</b> files into the
<b>bin</b> directory of your PDE project. When you are ready to test your
plug-in, you can launch a run-time workbench instance to test your new plug-in.</p>
<p>JDT plug-in provides the launching support that PDE uses by defining its own
launcher type called Run-time Workbench. The simplest way to activate it is by
selecting <b>Run-&gt;Run As-&gt;Run-time Workbench</b> from the main menu bar.
This will immediately create a second (run-time) workbench instance that will
appear after a while.</p>
<p>To gain full control over the way the run-time workbench is launched, select <b>Run-Run...</b>
from the main menu bar. This will bring the launch dialog up:</p>
<p align="center">
<img border="0" src="images/launch-dialog.gif" alt="Run-time workbench launcher - arguments" width="577" height="586" ></p>
<p align="left">You can create several configurations and give them unique
names, each one having different parameters. This allows you to test your
plug-in under different conditions by simply switching between different
configurations. For each configuration, you can define main arguments, control
plug-ins and fragments that will run, activate tracing and define parameters
common to all launchers.</p>
<p align="left">&quot;Workspace data&quot; field defines the workspace that will be used
by the run-time workbench. PDE will set the default value but you are free to
change it. You can select the Java VM that will be used to launch the instance,
as well as the VM and program arguments. At any point in time, you can restore
the default values using the provided button.</p>
<p align="left">PDE uses the values specified on the <b>Plug-in
Development-&gt;Target Environment</b> preference page to set the default program
arguments for the launch configuration.&nbsp; If you manually change these
values in the configuration, changes will only affect that particular
configuration.&nbsp; Changes made on the preference page will affect all
configurations created thereafter.</p>
<h2>Example:&nbsp; Running the Action Set</h2>
<p>Before running, make sure that
your environment is set up as described in <a href="pde_configuring.htm">Configuring PDE</a>. You
will want to have different workspaces for
design and run-time (as set by default).</p>
<p>Select <b>Run-&gt;Run As-&gt;Run-time Workbench </b>from the main menu. Another platform instance should open. Our new action set is not immediately visible,
so we need to activate it by selecting <b>Window-&gt;Customize Perspective-&gt;Other...</b>
and selecting the checkbox for &quot;Sample Action Set&quot; (the action set
that we added). &quot;Sample Menu&quot; should now show up in the menu bar with
the &quot;Sample Action&quot; item. Selecting it should output &quot;Hello, PDE world&quot;
to the Console view of the Debug perspective (in the host platform instance).</p>
<p>&nbsp;<br>
<a href="../hglegal2003.htm">
<img src = "../images/ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
</p>
</body>
</html>