| <!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->Run As->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">"Workspace data" 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->Target Environment</b> preference page to set the default program | |
| arguments for the launch configuration. If you manually change these | |
| values in the configuration, changes will only affect that particular | |
| configuration. Changes made on the preference page will affect all | |
| configurations created thereafter.</p> | |
| <h2>Example: 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->Run As->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->Customize Perspective->Other...</b> | |
| and selecting the checkbox for "Sample Action Set" (the action set | |
| that we added). "Sample Menu" should now show up in the menu bar with | |
| the "Sample Action" item. Selecting it should output "Hello, PDE world" | |
| to the Console view of the Debug perspective (in the host platform instance).</p> | |
| <p> <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> |