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
public abstract class DebugElement extends PlatformObject implements IDebugElement
Implementation of common function for debug elements.Clients may subclass this class.
- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description DebugElement(IDebugTarget target)
Constructs a debug element referring to an artifact in the given debug target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fireChangeEvent(int detail)
Fires a change event for this debug element with the specified detail code.void
fireCreationEvent()
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
fireTerminateEvent()
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.IDebugTarget
getDebugTarget()
Returns the debug target this element is contained in.ILaunch
getLaunch()
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 Detail
-
DebugElement
public DebugElement(IDebugTarget target)
Constructs a debug element referring to an artifact in the given debug target.- Parameters:
target
- debug target containing this element
-
-
Method Detail
-
getDebugTarget
public IDebugTarget 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
public ILaunch 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
public <T> T getAdapter(Class<T> adapter)
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:
IAdaptable.getAdapter(Class)
-
fireEvent
public void fireEvent(DebugEvent event)
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
protected void requestFailed(String message, Throwable e) throws DebugException
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
protected void notSupported(String message, Throwable e) throws DebugException
Throws a debug exception with a status code ofNOT_SUPPORTED
.- Parameters:
message
- exception messagee
- underlying exception ornull
- Throws:
DebugException
- if a problem is encountered
-
-