public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILaunchListener, ILaunchConfigurationListener, IDebugEventSetListener
ILaunch for client
use.
Clients may instantiate this class. Clients may subclass this class.
ILaunch,
ILaunchManager| Constructor and Description |
|---|
Launch(ILaunchConfiguration launchConfiguration,
String mode,
ISourceLocator locator)
Constructs a launch with the specified attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDebugTarget(IDebugTarget target)
Adds the given debug target to this launch.
|
void |
addProcess(IProcess process)
Adds the given process to this launch.
|
protected void |
addProcesses(IProcess[] processes)
Adds the given processes to this launch.
|
boolean |
canDisconnect()
Returns whether any processes or targets can be disconnected.
|
boolean |
canTerminate()
Returns whether this element can be terminated.
|
void |
disconnect()
Disconnects this element from its target.
|
protected void |
fireChanged()
Notifies listeners that this launch has changed.
|
protected void |
fireTerminate()
Notifies listeners that this launch has terminated.
|
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class
associated with this object.
|
String |
getAttribute(String key)
Returns the value of a client defined attribute.
|
Object[] |
getChildren()
Returns the children of this launch - a collection
of one or more debug targets and processes, possibly empty.
|
IDebugTarget |
getDebugTarget()
Returns the primary (first) debug target associated with this launch, or
null
if no debug target is associated with this launch. |
IDebugTarget[] |
getDebugTargets()
Returns all the debug targets associated with this launch,
or an empty collection if no debug targets are associated
with this launch.
|
protected List |
getDebugTargets0()
Returns the debug targets associated with this
launch, in its internal form - a list
|
ILaunchConfiguration |
getLaunchConfiguration()
Returns the configuration that was launched, or
null
if no configuration was launched. |
protected ILaunchManager |
getLaunchManager()
Returns the launch manager.
|
String |
getLaunchMode()
Returns the mode of this launch - one of the mode constants defined by
the launch manager.
|
IProcess[] |
getProcesses()
Returns the processes that were launched,
or an empty collection if no processes were launched.
|
protected List |
getProcesses0()
Returns the processes associated with this
launch, in its internal form - a list.
|
ISourceLocator |
getSourceLocator()
Returns the source locator to use for locating source elements for
the debug target associated with this launch, or
null
if source lookup is not supported. |
void |
handleDebugEvents(DebugEvent[] events)
Notifies this listener of the given debug events.
|
boolean |
hasChildren()
Returns whether this launch contains at least one process
or debug target.
|
boolean |
isDisconnected()
Returns whether all of the contained targets and processes are
disconnected.
|
boolean |
isTerminated()
Returns whether this element is terminated.
|
void |
launchAdded(ILaunch launch)
Notifies this listener that the specified launch
has been added.
|
void |
launchChanged(ILaunch launch)
Notifies this listener that the specified launch
has changed.
|
void |
launchConfigurationAdded(ILaunchConfiguration configuration)
The given launch configuration has been created.
|
void |
launchConfigurationChanged(ILaunchConfiguration configuration)
The given launch configuration has changed in some way.
|
void |
launchConfigurationRemoved(ILaunchConfiguration configuration)
The given launch configuration has been deleted.
|
void |
launchRemoved(ILaunch launch)
Notifies this listener that the specified
launch has been removed.
|
void |
removeDebugTarget(IDebugTarget target)
Removes the given debug target from this launch.
|
void |
removeProcess(IProcess process)
Removes the given process from this launch.
|
void |
setAttribute(String key,
String value)
Sets the value of a client defined attribute.
|
void |
setSourceLocator(ISourceLocator sourceLocator)
Sets the source locator to use for locating source elements for
the debug target associated with this launch, or
null
if source lookup is not supported. |
void |
terminate()
Causes this element to terminate, generating a
TERMINATE event. |
public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator)
launchConfiguration - the configuration that was launchedmode - the mode of this launch - run or debug (constants
defined by ILaunchManager)locator - the source locator to use for this debug session, or
null if not supportedpublic boolean canTerminate()
ITerminatecanTerminate in interface ITerminateITerminate.canTerminate()public Object[] getChildren()
ILaunchgetChildren in interface ILaunchIDebugTarget or IProcess),
or an empty arrayILaunch.getChildren()public IDebugTarget getDebugTarget()
ILaunchnull
if no debug target is associated with this launch. All debug targets
associated with this launch may be retrieved by
getDebugTargets().getDebugTarget in interface ILaunchnullILaunch.getDebugTarget()public IProcess[] getProcesses()
ILaunchgetProcesses in interface ILaunchILaunch.getProcesses()protected List getProcesses0()
public ISourceLocator getSourceLocator()
ILaunchnull
if source lookup is not supported.getSourceLocator in interface ILaunchILaunch.getSourceLocator()public void setSourceLocator(ISourceLocator sourceLocator)
ILaunchnull
if source lookup is not supported.setSourceLocator in interface ILaunchsourceLocator - source locator or nullILaunch.setSourceLocator(ISourceLocator)public boolean isTerminated()
ITerminateisTerminated in interface ITerminateITerminate.isTerminated()public void terminate()
throws DebugException
ITerminateTERMINATE event.
Implementations may be blocking or non-blocking.terminate in interface ITerminateDebugException - on failure. Reasons include:ITerminate.terminate()public String getLaunchMode()
ILaunchgetLaunchMode in interface ILaunchILaunch.getLaunchMode()public ILaunchConfiguration getLaunchConfiguration()
ILaunchnull
if no configuration was launched.getLaunchConfiguration in interface ILaunchnullILaunch.getLaunchConfiguration()public void setAttribute(String key, String value)
ILaunchsetAttribute in interface ILaunchkey - the attribute keyvalue - the attribute valueILaunch.setAttribute(String, String)public String getAttribute(String key)
ILaunchgetAttribute in interface ILaunchkey - the attribute keynull if undefinedILaunch.getAttribute(String)public IDebugTarget[] getDebugTargets()
ILaunchgetDebugTargets in interface ILaunchILaunch.getDebugTargets()protected List getDebugTargets0()
public void addDebugTarget(IDebugTarget target)
ILaunchaddDebugTarget in interface ILaunchtarget - debug target to add to this launchILaunch.addDebugTarget(IDebugTarget)public void removeDebugTarget(IDebugTarget target)
ILaunchremoveDebugTarget in interface ILaunchtarget - debug target to remove from this launchILaunch.removeDebugTarget(IDebugTarget)public void addProcess(IProcess process)
ILaunchaddProcess in interface ILaunchprocess - the process to add to this launchILaunch.addProcess(IProcess)public void removeProcess(IProcess process)
ILaunchremoveProcess in interface ILaunchprocess - the process to remove from this launchILaunch.removeProcess(IProcess)protected void addProcesses(IProcess[] processes)
processes - processes to addprotected void fireChanged()
protected void fireTerminate()
public boolean hasChildren()
ILaunchhasChildren in interface ILaunchILaunch.hasChildren()public boolean canDisconnect()
canDisconnect in interface IDisconnectIDisconnect.canDisconnect()public void disconnect()
throws DebugException
IDisconnectdisconnect in interface IDisconnectDebugException - on failure. Reasons include:IDisconnect.disconnect()public boolean isDisconnected()
isDisconnected in interface IDisconnectIDisconnect.isDisconnected()public void launchRemoved(ILaunch launch)
ILaunchListenerlaunchRemoved in interface ILaunchListenerlaunch - the removed launchprotected ILaunchManager getLaunchManager()
public void launchAdded(ILaunch launch)
ILaunchListenerlaunchAdded in interface ILaunchListenerlaunch - the newly added launchpublic void launchChanged(ILaunch launch)
ILaunchListenerlaunchChanged in interface ILaunchListenerlaunch - the changed launchpublic void launchConfigurationAdded(ILaunchConfiguration configuration)
ILaunchConfigurationListenerlaunchConfigurationAdded in interface ILaunchConfigurationListenerconfiguration - the newly created launch configurationpublic void launchConfigurationChanged(ILaunchConfiguration configuration)
ILaunchConfigurationListenerlaunchConfigurationChanged in interface ILaunchConfigurationListenerconfiguration - the launch configuration that has
changedpublic void launchConfigurationRemoved(ILaunchConfiguration configuration)
ILaunchConfigurationListenerThe launch configuration no longer exists. Data stored in the configuration can no longer be accessed, however handle-only attributes of the launch configuration can be retrieved.
launchConfigurationRemoved in interface ILaunchConfigurationListenerconfiguration - the deleted launch configurationpublic void handleDebugEvents(DebugEvent[] events)
IDebugEventSetListenerhandleDebugEvents in interface IDebugEventSetListenerevents - the debug eventspublic Object getAdapter(Class adapter)
PlatformObjectnull if
no such object can be found.
This implementation of the method declared by IAdaptable
passes the request along to the platform's adapter manager; roughly
Platform.getAdapterManager().getAdapter(this, adapter).
Subclasses may override this method (however, if they do so, they
should invoke the method on their superclass to ensure that the
Platform's adapter manager is consulted).
getAdapter in interface IAdaptablegetAdapter in class PlatformObjectadapter - the class to adapt tonullIAdaptable.getAdapter(Class),
Platform.getAdapterManager()Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.