To follow this example, import the Ping sample plug-in into your workspace. Build and launch an Eclipse Application with this plug-in.
This example uses the familiar ping command to test an IP address or domain name, writing output to the console. After launching your target Eclipse Application, use the following steps to ping an address.
Image of the launch configuration
dialog editing a Ping configuration.
ping.launchType
declaration (org.eclipse.debug.core.launchConfigurationTypes
extension point) in org.eclipse.debug.examples.ping/plugin.xml
org.eclipse.debug.examples.ping.PingLaunchDelegate
implementationping.tabGroup
declaration (org.eclipse.debug.ui.launchConfigurationTabGroups
extension point)org.eclipse.debug.examples.ping.PingTab
The Ping example constructs a simple command line and spawns a system process (java.lang.Process
). The system process is wrapped in an IProcess
and is added to an ILaunch
object. The launch object is displayed as a root element in the Debug view. A process provides access to its input and output streams which is displayed in a console. The debug platform automatically allocates a console for a process object registered with a launch. A process object monitors its underlying system process to know when it has terminated, and fires corresponding DebugEvent
's to notify the debug platform of its state. A user can terminate a process by selecting it and pressing the terminate button.
Image of Ping process and launch elements in
Debug view running and terminated.