Package org.eclipse.debug.core.model
Class DebugElement
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.debug.core.model.DebugElement
- All Implemented Interfaces:
IAdaptable
,IDebugElement
Implementation of common function for debug elements.
Clients may subclass this class.
- Since:
- 3.1
-
Constructor Summary
ConstructorsConstructorDescriptionDebugElement
(IDebugTarget target) Constructs a debug element referring to an artifact in the given debug target. -
Method Summary
Modifier and TypeMethodDescriptionvoid
fireChangeEvent
(int detail) Fires a change event for this debug element with the specified detail code.void
Fires a creation event for this debug element.void
fireEvent
(DebugEvent event) Fires a debug event.void
fireResumeEvent
(int detail) Fires a resume for this debug element with the specified detail code.void
fireSuspendEvent
(int detail) Fires a suspend event for this debug element with the specified detail code.void
Fires a terminate event for this debug element.<T> T
getAdapter
(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Returns the debug target this element is contained in.Returns the launch this element is contained in.protected void
notSupported
(String message, Throwable e) Throws a debug exception with a status code ofNOT_SUPPORTED
.protected void
requestFailed
(String message, Throwable e) Throws a debug exception with a status code ofTARGET_REQUEST_FAILED
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getModelIdentifier
-
Constructor Details
-
DebugElement
Constructs a debug element referring to an artifact in the given debug target.- Parameters:
target
- debug target containing this element
-
-
Method Details
-
getDebugTarget
Description copied from interface:IDebugElement
Returns the debug target this element is contained in.- Specified by:
getDebugTarget
in interfaceIDebugElement
- Returns:
- the debug target this element is contained in
-
getLaunch
Description copied from interface:IDebugElement
Returns the launch this element is contained in.- Specified by:
getLaunch
in interfaceIDebugElement
- Returns:
- the launch this element is contained in
-
getAdapter
Description copied from class:PlatformObject
Returns an object which is an instance of the given class associated with this object. Returnsnull
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; roughlyPlatform.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).- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classPlatformObject
- Type Parameters:
T
- the class type- Parameters:
adapter
- the class to adapt to- Returns:
- the adapted object or
null
- See Also:
-
fireEvent
Fires a debug event.- Parameters:
event
- debug event to fire
-
fireChangeEvent
public void fireChangeEvent(int detail) Fires a change event for this debug element with the specified detail code.- Parameters:
detail
- detail code for the change event, such asDebugEvent.STATE
orDebugEvent.CONTENT
-
fireCreationEvent
public void fireCreationEvent()Fires a creation event for this debug element. -
fireResumeEvent
public void fireResumeEvent(int detail) Fires a resume for this debug element with the specified detail code.- Parameters:
detail
- detail code for the resume event, such asDebugEvent.STEP_OVER
-
fireSuspendEvent
public void fireSuspendEvent(int detail) Fires a suspend event for this debug element with the specified detail code.- Parameters:
detail
- detail code for the suspend event, such asDebugEvent.BREAKPOINT
-
fireTerminateEvent
public void fireTerminateEvent()Fires a terminate event for this debug element. -
requestFailed
Throws a debug exception with a status code ofTARGET_REQUEST_FAILED
.- Parameters:
message
- exception messagee
- underlying exception ornull
- Throws:
DebugException
- if a problem is encountered
-
notSupported
Throws a debug exception with a status code ofNOT_SUPPORTED
.- Parameters:
message
- exception messagee
- underlying exception ornull
- Throws:
DebugException
- if a problem is encountered
-