Running a plug-in

As you develop your plug-in in the workspace, the incremental Java compiler will compile your Java source code and place the *.class files into the bin 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.

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 Run->Run As->Run-time Workbench from the main menu bar. This will immediately create a second (run-time) workbench instance that will appear after a while.

To gain full control over the way the run-time workbench is launched, select Run-Run... from the main menu bar. This will bring the launch dialog up:

Run-time workbench launcher - arguments

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.

"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.

PDE uses the values specified on the Plug-in Development->Target Environment 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.

Example:  Running the Action Set

Before running, make sure that your environment is set up as described in Configuring PDE. You will want to have different workspaces for design and run-time (as set by default).

Select Run->Run As->Run-time Workbench 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 Window->Customize Perspective->Other... 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).

 
Copyright IBM Corporation and others 2000, 2003