|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.debug.ui.DebugUITools
This class provides utilities for clients of the debug UI.
Images retrieved from this facility should not be disposed. The images will be disposed when this plugin is shutdown.
This class is not intended to be subclassed or instantiated.
Constructor Summary | |
DebugUITools()
|
Method Summary | |
static ILaunch |
buildAndLaunch(ILaunchConfiguration configuration,
String mode,
IProgressMonitor monitor)
Builds the workspace according to current preference settings, and launches the given configuration in the specified mode, returning the resulting launch object. |
static IProcess |
getCurrentProcess()
Returns the process associated with the current debug context. |
static IAdaptable |
getDebugContext()
Returns the currently selected element in the debug view of the current workbench page, or null if there is no current
debug context, or if not called from the UI
thread. |
static ImageDescriptor |
getDefaultImageDescriptor(Object element)
Returns the default image descriptor for the given element or null if none is defined. |
static Image |
getImage(String key)
Returns the shared image managed under the given key, or null
if none. |
static ImageDescriptor |
getImageDescriptor(String key)
Returns the shared image descriptor managed under the given key, or null if none. |
static IPreferenceStore |
getPreferenceStore()
Returns the preference store for the debug UI plugin. |
static void |
launch(ILaunchConfiguration configuration,
String mode)
Saves and builds the workspace according to current preference settings, and launches the given launch configuration in the specified mode with a progress dialog. |
static IDebugModelPresentation |
newDebugModelPresentation()
Returns a new debug model presentation that delegates to appropriate debug models. |
static IDebugModelPresentation |
newDebugModelPresentation(String identifier)
Returns a new debug model presentation for specified debug model, or null if a presentation does
not exist. |
static int |
openLaunchConfigurationDialog(Shell shell,
ILaunchConfiguration configuration,
String groupIdentifier,
IStatus status)
Open the launch configuration dialog on the specified launch configuration. |
static int |
openLaunchConfigurationDialog(Shell shell,
IStructuredSelection selection,
String mode)
Open the launch configuration dialog with the specified initial selection. |
static int |
openLaunchConfigurationDialogOnGroup(Shell shell,
IStructuredSelection selection,
String groupIdentifier)
Open the launch configuration dialog with the specified initial selection. |
static int |
openLaunchConfigurationDialogOnGroup(Shell shell,
IStructuredSelection selection,
String groupIdentifier,
IStatus status)
Open the launch configuration dialog with the specified initial selection. |
static int |
openLaunchConfigurationPropertiesDialog(Shell shell,
ILaunchConfiguration configuration,
String groupIdentifier)
Open the launch configuration properties dialog on the specified launch configuration. |
static boolean |
saveAndBuildBeforeLaunch()
Saves all dirty editors and builds the workspace according to current preference settings, and returns whether a launch should proceed. |
static boolean |
saveBeforeLaunch()
Saves all dirty editors according to current preference settings, and returns whether a launch should proceed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DebugUITools()
Method Detail |
public static Image getImage(String key)
null
if none.
Note that clients MUST NOT dispose the image returned by this method.
See IDebugUIConstants
for available images.
key
- the image keynull
if noneIDebugUIConstants
public static ImageDescriptor getImageDescriptor(String key)
null
if none.
See IDebugUIConstants
for available image descriptors.
key
- the image descriptor keynull
if noneIDebugUIConstants
public static ImageDescriptor getDefaultImageDescriptor(Object element)
null
if none is defined.public static IPreferenceStore getPreferenceStore()
public static IDebugModelPresentation newDebugModelPresentation()
It is the client's responsibility dispose the presentation.
IBaseLabelProvider.dispose()
public static IDebugModelPresentation newDebugModelPresentation(String identifier)
null
if a presentation does
not exist.
It is the client's responsibility dispose the presentation.
identifier
- debug model identifiernull
IBaseLabelProvider.dispose()
public static IAdaptable getDebugContext()
null
if there is no current
debug context, or if not called from the UI
thread.null
public static IProcess getCurrentProcess()
null
is returned.null
public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode)
null
, or contain any mix of
ILaunchConfiguration
or ILaunchConfigurationType
elements.
Before opening a new dialog, this method checks if there is an existing open launch configuration dialog. If there is, this dialog is used with the specified selection. If there is no existing dialog, a new one is created.
Note that if an existing dialog is reused, the mode
argument is ignored
and the existing dialog keeps its original mode.
shell
- the parent shell for the launch configuration dialogselection
- the initial selection for the dialogmode
- the mode (run or debug) in which to open the launch configuration dialog.
This should be one of the constants defined in ILaunchManager
.Window.OK
or Window.CANCEL
public static int openLaunchConfigurationDialogOnGroup(Shell shell, IStructuredSelection selection, String groupIdentifier)
null
, or contain any mix of
ILaunchConfiguration
or ILaunchConfigurationType
elements.
Before opening a new dialog, this method checks if there is an existing open launch configuration dialog. If there is, this dialog is used with the specified selection. If there is no existing dialog, a new one is created.
Note that if an existing dialog is reused, the mode
argument is ignored
and the existing dialog keeps its original mode.
shell
- the parent shell for the launch configuration dialogselection
- the initial selection for the dialoggroupIdentifier
- the identifier of the launch group to display (corresponds to
the identifier of a launch group extension)Window.OK
or Window.CANCEL
public static int openLaunchConfigurationDialogOnGroup(Shell shell, IStructuredSelection selection, String groupIdentifier, IStatus status)
null
, or contain any mix of
ILaunchConfiguration
or ILaunchConfigurationType
elements.
Before opening a new dialog, this method checks if there is an existing open launch configuration dialog. If there is, this dialog is used with the specified selection. If there is no existing dialog, a new one is created.
Note that if an existing dialog is reused, the mode
argument is ignored
and the existing dialog keeps its original mode.
If a status is specified, a status handler is consulted to handle the status. The status handler is passed the instance of the launch configuration dialog that is opened. This gives the status handler an opportunity to perform error handling/initialization as required.
shell
- the parent shell for the launch configuration dialogselection
- the initial selection for the dialoggroupIdentifier
- the identifier of the launch group to display (corresponds to
the identifier of a launch group extension)status
- the status to display in the dialog, or null
if noneWindow.OK
or Window.CANCEL
IStatusHandler
public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier)
shell
- the parent shell for the launch configuration dialogconfiguration
- the configuration to displaygroup
- identifier of the launch group the launch configuration
belongs toWindow.OK
or Window.CANCEL
public static int openLaunchConfigurationDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status)
If a status is specified, a status handler is consulted to handle the status. The status handler is passed the instance of the launch configuration dialog that is opened. This gives the status handler an opportunity to perform error handling/initialization as required.
shell
- the parent shell for the launch configuration dialogconfiguration
- the configuration to displaygroup
- identifier of the launch group the launch configuration
belongs tostatus
- the status to display, or null
if noneWindow.OK
or Window.CANCEL
public static boolean saveAndBuildBeforeLaunch()
The following preferences effect whether dirty editors are saved, and/or if the user is prompted to save dirty edtiors:
public static boolean saveBeforeLaunch()
The following preferences effect whether dirty editors are saved, and/or if the user is prompted to save dirty edtiors:
public static void launch(ILaunchConfiguration configuration, String mode)
configuration
- the configuration to launchmode
- launch mode - run or debugpublic static ILaunch buildAndLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
The following preference effects whether a build is performed before launching (if required):
configuration
- the configuration to launchmode
- the mode to launch inmonitor
- progress monitorCoreException
- if building or launching fails
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |