Interface ILaunchManager
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Launch configuration attribute name.static final String
Launch configuration attribute name.static final String
Launch configuration attribute - a boolean value that indicates if the launch configuration is 'private'.static final String
A launch in a special debug mode (value"debug"
).static final String
A launch in a special profile mode (value"profile"
).static final String
A launch in a normal, non-debug mode(value"run"
). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified launch and notifies listeners.void
Adds the given launch configuration listener to the list of listeners notified when a launch configuration is added, removed, or changed.void
addLaunches
(ILaunch[] launches) Adds the specified launch objects and notifies listeners.void
addLaunchListener
(ILaunchesListener listener) Adds the given listener to the collection of registered launch listeners.void
addLaunchListener
(ILaunchListener listener) Adds the given listener to the collection of registered launch listeners.generateLaunchConfigurationName
(String namePrefix) Returns a string that can be used as the name of a launch configuration.generateUniqueLaunchConfigurationNameFrom
(String namePrefix) Deprecated.Returns the collection of debug targets currently registered with this launch manager.getEncoding
(ILaunchConfiguration configuration) This method returns the character encoding to use when launching the specifiedILaunchConfiguration
.String[]
getEnvironment
(ILaunchConfiguration configuration) Returns an array of environment variables to be used when launching the given configuration ornull
if unspecified.getLaunchConfiguration
(String memento) Returns a handle to the launch configuration specified by the given memento.getLaunchConfiguration
(IFile file) Returns a handle to the launch configuration contained in the specified file.Returns all launch configurations defined in the workspace.getLaunchConfigurations
(int kinds) Returns all launch configurations defined in the workspace of the specified kind(s) (configurations and/or prototypes).Returns all launch configurations of the specified type defined in the workspacegetLaunchConfigurations
(ILaunchConfigurationType type, int kinds) Returns all launch configurations of the specified type defined in the workspace of the specified kind(s) (configurations and/or prototypes).Returns the launch configuration type extension with the specified id, ornull
if it does not exist.Returns all defined launch configuration type extensionsILaunch[]
Returns the collection of launches currently registered with this launch manager.getLaunchMode
(String mode) Returns the launch mode registered with the given mode identifier, ornull
if none.Returns all registered launch modes.Returns a collection of launch configurations that required migration to be compatible with current tooling.getMovedFrom
(ILaunchConfiguration addedConfiguration) When a launch configuration is created or moved, registered launch configuration listeners (seeILaunchConfigurationListener
) are notified of an add notification for the new configuration.getMovedTo
(ILaunchConfiguration removedConfiguration) When a launch configuration is deleted or moved, registered launch configuration listeners (seeILaunchConfigurationListener
) are notified of a remove notification for launch configuration that has been deleted.Returns the native system environment variables as a map of variable names and values (Strings).Returns the native system environment variables as a map of variable names and values (Strings).IProcess[]
Returns the collection of processes currently registered with this launch manager.Returns the source container type extension registered with the given unique identifier, ornull
if none.Returns all registered source container type extensions.Returns the source path computer extension registered with the given unique identifier, ornull
if none.getSourcePathComputer
(ILaunchConfiguration configuration) Returns a source path computer to compute a default source lookup path for the given launch configuration, ornull
if a source path computer has not been registered for the associated launch configuration type.boolean
Returntrue
if there is a launch configuration with the specified name,false
otherwise.boolean
isRegistered
(ILaunch launch) Returns whether the given launch is currently registered.boolean
isValidLaunchConfigurationName
(String configname) Returns if the given name is valid or not.newSourceLocator
(String identifier) Creates and returns a new source locator of the specified type.void
removeLaunch
(ILaunch launch) Removes the specified launch and notifies listeners.void
Removes the given launch configuration listener from the list of listeners notified when a launch configuration is added, removed, or changed.void
removeLaunches
(ILaunch[] launches) Removes the specified launch objects and notifies listeners.void
removeLaunchListener
(ILaunchesListener listener) Removes the given listener from the collection of registered launch listeners.void
removeLaunchListener
(ILaunchListener listener) Removes the given listener from the collection of registered launch listeners.
-
Field Details
-
RUN_MODE
A launch in a normal, non-debug mode(value"run"
).- See Also:
-
DEBUG_MODE
A launch in a special debug mode (value"debug"
).- See Also:
-
PROFILE_MODE
A launch in a special profile mode (value"profile"
).- Since:
- 3.0
- See Also:
-
ATTR_PRIVATE
Launch configuration attribute - a boolean value that indicates if the launch configuration is 'private'. A private configuration is one that does not appear in the user interface (launch history or the launch configuration dialog).- Since:
- 3.6
- See Also:
-
ATTR_ENVIRONMENT_VARIABLES
Launch configuration attribute name. The value is a map of environment variables passed into Runtime.exec(...) when a launch configuration is launched. Default value isnull
which indicates the default environment should be used.- Since:
- 3.0
-
ATTR_APPEND_ENVIRONMENT_VARIABLES
Launch configuration attribute name. The value is a boolean value specifying whether the environment variables in a launch configuration should be appended to the native environment (i.e. whentrue
), or if they should replace the environment (i.e.false
). The default value istrue
.- Since:
- 3.0
-
-
Method Details
-
addLaunch
Adds the specified launch and notifies listeners. Has no effect if an identical launch is already registered.- Parameters:
launch
- the launch to add- Since:
- 2.0
-
addLaunchConfigurationListener
Adds the given launch configuration listener to the list of listeners notified when a launch configuration is added, removed, or changed. Has no effect if the given listener is already registered.- Parameters:
listener
- launch configuration listener- Since:
- 2.0
-
addLaunches
Adds the specified launch objects and notifies listeners. Has no effect on identical launch objects already registered.- Parameters:
launches
- the launch objects to add- Since:
- 2.1
-
addLaunchListener
Adds the given listener to the collection of registered launch listeners. Has no effect if an identical listener is already registered.- Parameters:
listener
- the listener to register- Since:
- 2.1
-
addLaunchListener
Adds the given listener to the collection of registered launch listeners. Has no effect if an identical listener is already registered.- Parameters:
listener
- the listener to register
-
generateUniqueLaunchConfigurationNameFrom
Deprecated.since 3.6 clients should use thegenerateLaunchConfigurationName(String)
method which will perform validation of the name and correct unsupported name parts.Return a String that can be used as the name of a launch configuration. The name is guaranteed to be unique (no existing launch configurations will have this name). The name that is returned uses thenamePrefix
as a starting point. If there is no existing launch configuration with this name, thennamePrefix
is returned. Otherwise, the value returned consists of the specified prefix plus some suffix that guarantees uniqueness.- Parameters:
namePrefix
- the String that the returned name must begin with- Returns:
- launch configuration name
- Since:
- 2.0
-
generateLaunchConfigurationName
Returns a string that can be used as the name of a launch configuration. The name is guaranteed to be unique (no existing launch configurations will have this name). The name that is returned uses thenamePrefix
as a starting point. If there is no existing launch configuration with this name, thennamePrefix
is returned. Otherwise, the value returned consists of the specified prefix plus some suffix that guarantees uniqueness.If the name prefix does not pass name validation any illegal parts of the name will be removed during the name generation. Illegal characters will be replaced with '_' and illegal names will be replaced with "_reserved_".
- Parameters:
namePrefix
- the string that the returned name should begin with- Returns:
- launch configuration name
- Since:
- 3.6
-
isValidLaunchConfigurationName
Returns if the given name is valid or not. If an invalid name part is located anIllegalArgumentException
is thrown.- Parameters:
configname
- the name to check- Returns:
- true if the given name is valid or throws an exception if not, where an invalid name is either a reserved system name (like 'aux' on Win 32) or the name contains invalid characters (like ':' or '/').
- Throws:
IllegalArgumentException
- if the name is invalid, where an invalid is either a reserved system name (like 'aux' on Win 32) or the name contains invalid characters (like ':' or '/').- Since:
- 3.6
-
getDebugTargets
IDebugTarget[] getDebugTargets()Returns the collection of debug targets currently registered with this launch manager.- Returns:
- an array of debug targets
-
getEnvironment
Returns an array of environment variables to be used when launching the given configuration ornull
if unspecified. Each entry is of the form "var_name=value
".- Parameters:
configuration
- launch configuration- Returns:
- an array of environment variables to use when launching the given
configuration or
null
if unspecified - Throws:
CoreException
- if unable to access associated attribute or if unable to resolve a variable in an environment variable's value- Since:
- 3.0
-
getEncoding
This method returns the character encoding to use when launching the specifiedILaunchConfiguration
. The returned encoding can be derived from one of three places in the following order:- An attribute saved on the configuration itself (where no attribute means use the default encoding).
- The mapped resources for the configuration, in the event one of them has a specific encoding that is not the workspace default. If there are more than one mapped resource we optimistically ask only the first resource for its encoding.
- We ask the
ResourcesPlugin
for the workspace preference (which resolves back to the system propertyfile.encoding
if the user has made no changes to the workspace encoding preference).
Note: if
DebugPlugin.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING
is set,Platform.getSystemCharset()
is returned.- Parameters:
configuration
- theILaunchConfiguration
to get the encoding for- Returns:
- the encoding to use when launching the specified
ILaunchConfiguration
- Throws:
CoreException
- if a problem is encountered- Since:
- 3.4
-
getLaunchConfiguration
Returns a handle to the launch configuration contained in the specified file. This method does not check if the specifiedIFile
is a launch configuration file or that it exists in the local or remote file system.Since 3.12, the returned configuration may be a launch configuration template.
- Parameters:
file
- launch configuration file- Returns:
- a handle to the launch configuration contained in the specified file
- Since:
- 2.0
-
getLaunchConfiguration
Returns a handle to the launch configuration specified by the given memento. The configuration may not exist.Since 3.12, the returned configuration may be a launch configuration template.
- Parameters:
memento
- launch configuration memento- Returns:
- a handle to the launch configuration specified by the given memento
- Throws:
CoreException
- if the given memento is invalid or an exception occurs parsing the memento- Since:
- 2.0
- See Also:
-
getLaunchConfigurations
Returns all launch configurations defined in the workspace.- Returns:
- all launch configurations defined in the workspace
- Throws:
CoreException
- if an exception occurs retrieving configurations- Since:
- 2.0
- See Also:
-
getLaunchConfigurations
Returns all launch configurations of the specified type defined in the workspaceDoes not include launch configuration templates.
- Parameters:
type
- a launch configuration type- Returns:
- all launch configurations of the specified type defined in the workspace
- Throws:
CoreException
- if an error occurs while retrieving a launch configuration- Since:
- 2.0
- See Also:
-
getLaunchConfigurations
Returns all launch configurations defined in the workspace of the specified kind(s) (configurations and/or prototypes).- Parameters:
kinds
- bit mask of kinds of configurations to consider- Returns:
- all launch configurations defined in the workspace
- Throws:
CoreException
- if an exception occurs retrieving configurations- Since:
- 3.12
- See Also:
-
getLaunchConfigurations
ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type, int kinds) throws CoreException Returns all launch configurations of the specified type defined in the workspace of the specified kind(s) (configurations and/or prototypes).- Parameters:
type
- a launch configuration typekinds
- bit mask of kinds of configurations to consider- Returns:
- all launch configurations of the specified type defined in the workspace
- Throws:
CoreException
- if an error occurs while retrieving a launch configuration- Since:
- 3.12
- See Also:
-
getLaunchConfigurationType
Returns the launch configuration type extension with the specified id, ornull
if it does not exist.- Parameters:
id
- unique identifier for a launch configuration type extension- Returns:
- the launch configuration type extension with the specified
id, or
null
if it does not exist - Since:
- 2.0
-
getLaunchConfigurationTypes
ILaunchConfigurationType[] getLaunchConfigurationTypes()Returns all defined launch configuration type extensions- Returns:
- all defined launch configuration type extensions
- Since:
- 2.0
-
getLaunches
ILaunch[] getLaunches()Returns the collection of launches currently registered with this launch manager.- Returns:
- an array of launches
-
getLaunchMode
Returns the launch mode registered with the given mode identifier, ornull
if none.- Parameters:
mode
- mode identifier- Returns:
- launch mode or
null
- Since:
- 3.0
-
getLaunchModes
ILaunchMode[] getLaunchModes()Returns all registered launch modes.- Returns:
- all registered launch modes
- Since:
- 3.0
-
getMigrationCandidates
Returns a collection of launch configurations that required migration to be compatible with current tooling.- Returns:
- a collection of launch configurations that required migration
- Throws:
CoreException
- if an exception occurs determining migration candidates- Since:
- 3.2
-
getMovedFrom
When a launch configuration is created or moved, registered launch configuration listeners (seeILaunchConfigurationListener
) are notified of an add notification for the new configuration. If the notification is the result of a move this method will return a handle to the launch configuration that the added launch configuration was moved from. This method returnsnull
if the added launch configuration was not the result of a rename or move. This information is only available during the add notification call backlaunchConfigurationAdded
.Renaming a configuration is considered the same as moving a configuration.
- Parameters:
addedConfiguration
- a launch configuration for which an add notification is being broadcast- Returns:
- the launch configuration that the added launch configuration was
moved from, or
null
if the add notification is not the result of a move - Since:
- 2.1
-
getMovedTo
When a launch configuration is deleted or moved, registered launch configuration listeners (seeILaunchConfigurationListener
) are notified of a remove notification for launch configuration that has been deleted. If the notification is the result of a move this method will return a handle to the launch configuration that the removed launch configuration was moved to. This method returnsnull
if the removed launch configuration was not the result of a rename or move. This information is only available during the add notification call backlaunchConfigurationRemoved
.Renaming a configuration is considered the same as moving a configuration.
- Parameters:
removedConfiguration
- a launch configuration for which a remove notification is being broadcast- Returns:
- the launch configuration that the removed launch configuration
was moved to, or
null
if the add notification is not the result of a move - Since:
- 2.1
-
getNativeEnvironment
Returns the native system environment variables as a map of variable names and values (Strings).Note that WIN32 system environment preserves the case of variable names but is otherwise case insensitive. Depending on what you intend to do with the environment, the lack of normalization may or may not be create problems. On WIN32, this method normalizes mixed-case keys variable names to upper case. Use
getNativeEnvironmentCasePreserved()
instead to get a WIN32 system environment where the keys are the mixed-case variable names recorded by the OS.- Returns:
- the native system environment variables; on WIN32, mixed-case
variable names (keys) have been normalized to upper case
(key type:
String
; value type:String
) - Since:
- 3.0
-
getNativeEnvironmentCasePreserved
Returns the native system environment variables as a map of variable names and values (Strings).Note that WIN32 system environment preserves the case of variable names but is otherwise case insensitive. Depending on what you intend to do with the environment, the lack of normalization may or may not be create problems. This method returns mixed-case keys using the variable names recorded by the OS. Use
getNativeEnvironment()
instead to get a WIN32 system environment where all keys have been normalized to upper case.- Returns:
- the native system environment variables; on WIN32, mixed-case
variable names (keys) are returned without normalization
(key type:
String
; value type:String
) - Since:
- 3.1
-
getProcesses
IProcess[] getProcesses()Returns the collection of processes currently registered with this launch manager.- Returns:
- an array of processes
-
getSourceContainerType
Returns the source container type extension registered with the given unique identifier, ornull
if none.- Parameters:
id
- unique identifier of a source container type extension- Returns:
- the source container type extension registered with the
given unique identifier, or
null
if none - Since:
- 3.0
-
getSourceContainerTypes
ISourceContainerType[] getSourceContainerTypes()Returns all registered source container type extensions.- Returns:
- all registered source container type extensions
- Since:
- 3.0
-
getSourcePathComputer
Returns a source path computer to compute a default source lookup path for the given launch configuration, ornull
if a source path computer has not been registered for the associated launch configuration type.- Parameters:
configuration
- a launch configuration- Returns:
- a source path computer registered for the associated launch
configurations type, or
null
if unspecified - Throws:
CoreException
- if an exception occurs while instantiating a source path computer- Since:
- 3.0
-
getSourcePathComputer
Returns the source path computer extension registered with the given unique identifier, ornull
if none.- Parameters:
id
- source path computer identifier- Returns:
- the source path computer extension registered with the given
unique identifier, or
null
if none - Since:
- 3.0
-
isExistingLaunchConfigurationName
Returntrue
if there is a launch configuration with the specified name,false
otherwise.- Parameters:
name
- the name of the launch configuration whose existence is being checked- Returns:
- whether a launch configuration already exists with the given name
- Throws:
CoreException
- if unable to retrieve existing launch configuration names- Since:
- 2.0
-
isRegistered
Returns whether the given launch is currently registered.- Parameters:
launch
- a launch- Returns:
- whether the launch is currently registered
- Since:
- 3.1
-
newSourceLocator
Creates and returns a new source locator of the specified type.- Parameters:
identifier
- the identifier associated with a persistable source locator extension- Returns:
- a source locator
- Throws:
CoreException
- if an exception occurs creating the source locator- Since:
- 2.0
-
removeLaunch
Removes the specified launch and notifies listeners. Has no effect if an identical launch is not already registered.- Parameters:
launch
- the launch to remove- Since:
- 2.0
-
removeLaunchConfigurationListener
Removes the given launch configuration listener from the list of listeners notified when a launch configuration is added, removed, or changed. Has no effect if the given listener is not already registered.- Parameters:
listener
- launch configuration listener- Since:
- 2.0
-
removeLaunches
Removes the specified launch objects and notifies listeners. Has no effect on identical launch objects that are not already registered.- Parameters:
launches
- the launch objects to remove- Since:
- 2.1
-
removeLaunchListener
Removes the given listener from the collection of registered launch listeners. Has no effect if an identical listener is not already registered.- Parameters:
listener
- the listener to unregister- Since:
- 2.1
-
removeLaunchListener
Removes the given listener from the collection of registered launch listeners. Has no effect if an identical listener is not already registered.- Parameters:
listener
- the listener to unregister
-
generateLaunchConfigurationName(String)
method which will perform validation of the name and correct unsupported name parts.