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 Details

    • 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 Details

    • getDebugTarget

      public IDebugTarget getDebugTarget()
      Description copied from interface: IDebugElement
      Returns the debug target this element is contained in.
      Specified by:
      getDebugTarget in interface IDebugElement
      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 interface IDebugElement
      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. Returns null 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; roughly Platform.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 interface IAdaptable
      Overrides:
      getAdapter in class PlatformObject
      Type Parameters:
      T - the class type
      Parameters:
      adapter - the class to adapt to
      Returns:
      the adapted object or null
      See Also:
    • 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 as DebugEvent.STATE or DebugEvent.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 as DebugEvent.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 as DebugEvent.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 of TARGET_REQUEST_FAILED.
      Parameters:
      message - exception message
      e - underlying exception or null
      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 of NOT_SUPPORTED.
      Parameters:
      message - exception message
      e - underlying exception or null
      Throws:
      DebugException - if a problem is encountered