Launch Module

Methods in the launch module ease writing scripts to perform complicated launch set-up and control. The key method is .launch(String, String).

A simple example of its use is:

 loadModule("/System/Launch")
 launch("Client", "debug")
 
where "Client" is the name of a launch configuration in the workbench and "debug" is the launch mode to use.

More examples of using the launch method are available in JavaScript Snippets.

Method Overview

Method Description
getLaunchConfiguration() Return the launch configuration given by name parameter.
getLaunchConfigurationNames() Returns an array of all the Launch Configuration Names known to the Launch Manager.
getLaunchConfigurations() Returns an array of all the Launch Configurations known to the Launch Manager.
getLaunchManager() Obtain the platform launch manager.
launch() Launch the configuration given by name, or an ILaunchConfiguration, and return the ILaunch for further processing.
launchUI() Launch the configuration given by name, or an ILaunchConfiguration, in the UI thread.

Methods

getLaunchConfiguration

ILaunchConfiguration getLaunchConfiguration(String name) throws CoreException, IllegalArgumentException

Return the launch configuration given by name parameter. The launch configuration can be edited or otherwise operated on.

name
the launch configuration name

the named launch configuration

CoreException
if an exception occurs retrieving configurations
IllegalArgumentException
if the name is not known to the launch manager

getLaunchConfigurationNames

String[] getLaunchConfigurationNames() throws CoreException

Returns an array of all the Launch Configuration Names known to the Launch Manager. These names can be used as the argument to the getLaunchConfiguration(), launch() and launchUI() methods.

array of launch configuration names.

CoreException
if an exception occurs retrieving configurations

getLaunchConfigurations

ILaunchConfiguration[] getLaunchConfigurations() throws CoreException

Returns an array of all the Launch Configurations known to the Launch Manager. These can be used as the argument to launch() and launchUI() methods.

array of launch configurations

CoreException
if an exception occurs retrieving configurations

getLaunchManager

ILaunchManager getLaunchManager()

Obtain the platform launch manager. This allows access to the Eclipse debug core launch manager, allowing control over all non-UI aspects of launches. The most valuable of these should be wrapped for ideal script usage and made available in the module itself.

the launch manager

launch

ILaunch launch(Object launchConfiguration, [String mode]) throws CoreException

Launch the configuration given by name, or an ILaunchConfiguration, and return the ILaunch for further processing.

This is the way to launch a configuration within a script which is itself launched. Consider using launchUI() if a full UI style launch is required, for example when invoked from the interactive console.

launchConfiguration
the ILaunchConfiguration, or the name of the launch configuration to be resolved with getLaunchConfiguration()
mode
the launch mode, normally "debug" or "run" but can be any of the launch modes available on the platform. The default value is "run".Optional: defaults to <run>.

the resulting launch

CoreException
if an exception occurs retrieving configurations

launchUI

void launchUI(Object launchConfiguration, [String mode]) throws CoreException

Launch the configuration given by name, or an ILaunchConfiguration, in the UI thread. This method respects the workspace settings for things like building before launching.

This method, unlike launch(), does not return the ILaunch because it is delegated to run via the UI thread and perform UI tasks before the launch (such as prompting the user).

launchConfiguration
the ILaunchConfiguration, or the name of the launch configuration to be resolved with getLaunchConfiguration()
mode
the launch mode, normally "debug" or "run" but can be any of the launch modes available on the platform. The default value is "run".Optional: defaults to <run>.
CoreException
if an exception occurs retrieving configurations