PTP
Release 7.0

org.eclipse.ptp.core.util
Class LaunchUtils

java.lang.Object
  extended by org.eclipse.ptp.core.util.LaunchUtils

public class LaunchUtils
extends java.lang.Object

Utility methods for managing launch configuration attributes.

Since:
6.0

Constructor Summary
LaunchUtils()
          Constructor
 
Method Summary
static java.lang.String getArguments(ILaunchConfiguration configuration)
          Get the program arguments specified in the Arguments tab
static java.lang.String getConnectionName(ILaunchConfiguration configuration)
          Get the connection name specified in the Resources tab
static boolean getCopyExecutable(ILaunchConfiguration configuration)
          Get if the executable shall be copied to remote target before launch.
static java.lang.String getDebuggerExePath(ILaunchConfiguration configuration)
          Get the debugger executable path
static java.lang.String getDebuggerID(ILaunchConfiguration configuration)
          Get the ID of the debugger for this launch
static boolean getDebuggerStopInMainFlag(ILaunchConfiguration configuration)
          Get the debugger "stop in main" flag
static java.lang.String getDebuggerWorkDirectory(ILaunchConfiguration configuration)
          Get the working directory for this debug session
static java.lang.String getExecutablePath(ILaunchConfiguration configuration)
          Get the absolute path of the executable to launch.
static java.lang.String[] getProgramArguments(ILaunchConfiguration configuration)
          Convert application arguments to an array of strings.
static java.lang.String getProgramName(ILaunchConfiguration configuration)
          Get the name of the executable to launch
static java.lang.String getProgramPath(ILaunchConfiguration configuration)
          Get the path component of the executable to launch.
static IProject getProject(java.lang.String project)
          Get the IProject object from the project name.
static java.lang.String getProjectName(ILaunchConfiguration configuration)
          Get the name of the project
static java.lang.String getRemoteServicesId(ILaunchConfiguration configuration)
          Get the remote services ID specified in the Resources tab (possibly implicitly)
static java.lang.String getResourceManagerUniqueName(ILaunchConfiguration configuration)
          Get the target controller to use for the launch
static java.lang.String getSystemType(ILaunchConfiguration configuration)
          Given a launch configuration, find the system type that was been selected.
static java.lang.String getTemplateName(ILaunchConfiguration configuration)
          Given a launch configuration, find the template name that was been selected.
static java.lang.String getWorkingDirectory(ILaunchConfiguration configuration)
          Get the working directory for the application launch
static IWorkspaceRoot getWorkspaceRoot()
          Get the workspace root.
static void setConfigurationName(ILaunchConfigurationWorkingCopy configuration, java.lang.String name)
          Set the name of the launch configuration
static void setConnectionName(ILaunchConfigurationWorkingCopy configuration, java.lang.String name)
          Set the connection name attribute
static void setRemoteServicesId(ILaunchConfigurationWorkingCopy configuration, java.lang.String id)
          Set the remote services ID attribute
static void setResourceManagerUniqueName(ILaunchConfigurationWorkingCopy configuration, java.lang.String id)
          Set the target controller used for the launch
static void setSystemType(ILaunchConfigurationWorkingCopy configuration, java.lang.String type)
          Set the target system type used for the launch
static void setWorkingDirectory(ILaunchConfigurationWorkingCopy configuration, java.lang.String dir)
          Set the working directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaunchUtils

public LaunchUtils()
Constructor

Method Detail

getArguments

public static java.lang.String getArguments(ILaunchConfiguration configuration)
                                     throws CoreException
Get the program arguments specified in the Arguments tab

Parameters:
configuration -
Returns:
program arguments string
Throws:
CoreException

getConnectionName

public static java.lang.String getConnectionName(ILaunchConfiguration configuration)
Get the connection name specified in the Resources tab

Parameters:
configuration -
Returns:
connection name
Since:
6.0

getCopyExecutable

public static boolean getCopyExecutable(ILaunchConfiguration configuration)
                                 throws CoreException
Get if the executable shall be copied to remote target before launch.

Parameters:
configuration -
Returns:
copy executable attribute
Throws:
CoreException

getDebuggerExePath

public static java.lang.String getDebuggerExePath(ILaunchConfiguration configuration)
                                           throws CoreException
Get the debugger executable path

Parameters:
configuration -
Returns:
debugger executable path
Throws:
CoreException

getDebuggerID

public static java.lang.String getDebuggerID(ILaunchConfiguration configuration)
                                      throws CoreException
Get the ID of the debugger for this launch

Parameters:
configuration -
Returns:
debugger ID
Throws:
CoreException

getDebuggerStopInMainFlag

public static boolean getDebuggerStopInMainFlag(ILaunchConfiguration configuration)
                                         throws CoreException
Get the debugger "stop in main" flag

Parameters:
configuration -
Returns:
"stop in main" flag
Throws:
CoreException

getDebuggerWorkDirectory

public static java.lang.String getDebuggerWorkDirectory(ILaunchConfiguration configuration)
                                                 throws CoreException
Get the working directory for this debug session

Parameters:
configuration -
Returns:
working directory
Throws:
CoreException

getExecutablePath

public static java.lang.String getExecutablePath(ILaunchConfiguration configuration)
                                          throws CoreException
Get the absolute path of the executable to launch. If the executable is on a remote machine, this is the path to the executable on that machine.

Parameters:
configuration -
Returns:
executable path
Throws:
CoreException

getProgramArguments

public static java.lang.String[] getProgramArguments(ILaunchConfiguration configuration)
                                              throws CoreException
Convert application arguments to an array of strings.

Parameters:
configuration - launch configuration
Returns:
array of strings containing the program arguments
Throws:
CoreException

getProgramName

public static java.lang.String getProgramName(ILaunchConfiguration configuration)
                                       throws CoreException
Get the name of the executable to launch

Parameters:
configuration -
Returns:
program name
Throws:
CoreException

getProgramPath

public static java.lang.String getProgramPath(ILaunchConfiguration configuration)
                                       throws CoreException
Get the path component of the executable to launch.

Parameters:
configuration -
Returns:
program path
Throws:
CoreException
Since:
5.0

getProject

public static IProject getProject(java.lang.String project)
Get the IProject object from the project name.

Parameters:
project - name of the project
Returns:
IProject resource

getProjectName

public static java.lang.String getProjectName(ILaunchConfiguration configuration)
                                       throws CoreException
Get the name of the project

Parameters:
configuration -
Returns:
project name specified in the Application tab
Throws:
CoreException

getRemoteServicesId

public static java.lang.String getRemoteServicesId(ILaunchConfiguration configuration)
Get the remote services ID specified in the Resources tab (possibly implicitly)

Parameters:
configuration -
Returns:
remote services ID
Since:
6.0

getResourceManagerUniqueName

public static java.lang.String getResourceManagerUniqueName(ILaunchConfiguration configuration)
Get the target controller to use for the launch

Parameters:
configuration -
Returns:
Throws:
CoreException

getSystemType

public static java.lang.String getSystemType(ILaunchConfiguration configuration)
Given a launch configuration, find the system type that was been selected.

Parameters:
configuration -
Returns:
resource manager type
Throws:
CoreException
Since:
6.0

getTemplateName

public static java.lang.String getTemplateName(ILaunchConfiguration configuration)
Given a launch configuration, find the template name that was been selected.

Parameters:
configuration -
Returns:
resource manager type
Throws:
CoreException
Since:
6.0

getWorkingDirectory

public static java.lang.String getWorkingDirectory(ILaunchConfiguration configuration)
                                            throws CoreException
Get the working directory for the application launch

Parameters:
configuration -
Returns:
Throws:
CoreException
Since:
5.0

getWorkspaceRoot

public static IWorkspaceRoot getWorkspaceRoot()
Get the workspace root.

Returns:
workspace root

setConnectionName

public static void setConnectionName(ILaunchConfigurationWorkingCopy configuration,
                                     java.lang.String name)
Set the connection name attribute

Parameters:
configuration -
name - connection name
Since:
6.0

setRemoteServicesId

public static void setRemoteServicesId(ILaunchConfigurationWorkingCopy configuration,
                                       java.lang.String id)
Set the remote services ID attribute

Parameters:
configuration -
id - remote services ID
Since:
6.0

setResourceManagerUniqueName

public static void setResourceManagerUniqueName(ILaunchConfigurationWorkingCopy configuration,
                                                java.lang.String id)
Set the target controller used for the launch

Parameters:
configuration -
Since:
6.0

setSystemType

public static void setSystemType(ILaunchConfigurationWorkingCopy configuration,
                                 java.lang.String type)
Set the target system type used for the launch

Parameters:
configuration -
type - target system type
Since:
6.0

setConfigurationName

public static void setConfigurationName(ILaunchConfigurationWorkingCopy configuration,
                                        java.lang.String name)
Set the name of the launch configuration

Parameters:
configuration -
name - configuration name
Since:
6.0

setWorkingDirectory

public static void setWorkingDirectory(ILaunchConfigurationWorkingCopy configuration,
                                       java.lang.String dir)
                                throws CoreException
Set the working directory

Parameters:
configuration -
dir -
Throws:
CoreException
Since:
5.0

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.