Eclipse Platform
2.0

org.eclipse.debug.ui
Class DebugUITools

java.lang.Object
  |
  +--org.eclipse.debug.ui.DebugUITools

public class DebugUITools
extends Object

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 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 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, IStructuredSelection selection, String mode)
          Open the launch configuration dialog with the specified initial selection.
static boolean saveAndBuildBeforeLaunch()
          Saves all dirty editors and builds the workspace 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

DebugUITools

public DebugUITools()
Method Detail

getImage

public static Image getImage(String key)
Returns the shared image managed under the given key, or null if none.

Note that clients MUST NOT dispose the image returned by this method.

See IDebugUIConstants for available images.

Parameters:
key - the image key
Returns:
the image, or null if none
See Also:
IDebugUIConstants

getImageDescriptor

public static ImageDescriptor getImageDescriptor(String key)
Returns the shared image descriptor managed under the given key, or null if none.

See IDebugUIConstants for available image descriptors.

Parameters:
key - the image descriptor key
Returns:
the image descriptor, or null if none
See Also:
IDebugUIConstants

getDefaultImageDescriptor

public static ImageDescriptor getDefaultImageDescriptor(Object element)
Returns the default image descriptor for the given element or null if none is defined.


getPreferenceStore

public static IPreferenceStore getPreferenceStore()
Returns the preference store for the debug UI plugin.

Returns:
preference store

newDebugModelPresentation

public static IDebugModelPresentation newDebugModelPresentation()
Returns a new debug model presentation that delegates to appropriate debug models.

It is the client's responsibility dispose the presentation.

Returns:
a debug model presentation
Since:
2.0
See Also:
IBaseLabelProvider.dispose()

newDebugModelPresentation

public static IDebugModelPresentation newDebugModelPresentation(String identifier)
Returns a new debug model presentation for specified debug model, or null if a presentation does not exist.

It is the client's responsibility dispose the presentation.

Parameters:
identifier - debug model identifier
Returns:
a debug model presentation, or null
Since:
2.0
See Also:
IBaseLabelProvider.dispose()

getDebugContext

public 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.

Returns:
the currently selected debug context, or null
Since:
2.0

getCurrentProcess

public static IProcess getCurrentProcess()
Returns the process associated with the current debug context. If there is no debug context currently, the most recently launched process is returned. If there is no current process null is returned.

Returns:
the current process, or null
Since:
2.0

openLaunchConfigurationDialog

public static int openLaunchConfigurationDialog(Shell shell,
                                                IStructuredSelection selection,
                                                String mode)
Open the launch configuration dialog with the specified initial selection. The selection may be null, or contain any mix of ILaunchConfiguration or ILaunchConfigurationType elements.

Parameters:
shell - the parent shell for the launch configuration dialog
selection - the initial selection for the dialog
mode - the mode (run or debug) in which to open the launch configuration dialog. This should be one of the constants defined in ILaunchManager.
Returns:
the return code from opening the launch configuration dialog
Since:
2.0

saveAndBuildBeforeLaunch

public static boolean saveAndBuildBeforeLaunch()
Saves all dirty editors and builds the workspace according to current preference settings, and returns whether a launch should proceed.

The following preferences effect whether dirty editors are saved, and/or if the user is prompted to save dirty edtiors:

The following preference effects whether a build is performed before launching (if required):

Returns:
whether a launch should proceed
Since:
2.0

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.