edu.rice.cs.drjava.model.debug
Class DocumentDebugAction

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.debug.DebugAction
        |
        +--edu.rice.cs.drjava.model.debug.DocumentDebugAction
Direct Known Subclasses:
Breakpoint

public abstract class DocumentDebugAction
extends DebugAction

Superclasses all DebugActions that are associated with specific OpenDefinitionsDocuments.

Version:
$Id: DocumentDebugAction.java,v 1.9 2002/09/13 22:55:34 csreis Exp $

Field Summary
protected  String _className
           
protected  OpenDefinitionsDocument _doc
           
protected  File _file
           
 
Fields inherited from class edu.rice.cs.drjava.model.debug.DebugAction
_countFilter, _enabled, _lineNumber, _manager, _requests, _suspendPolicy, ANY_LINE
 
Constructor Summary
DocumentDebugAction(DebugManager manager, OpenDefinitionsDocument doc, int offset)
          Creates a new DocumentDebugAction.
 
Method Summary
protected abstract  void _createRequests(gj.util.Vector refTypes)
          Creates appropriate EventRequests from the EventRequestManager and stores them in the _requests field.
protected  void _initializeRequests(gj.util.Vector refTypes)
          This should always be called from the constructor of the subclass.
protected  void _prepareRequest(com.sun.jdi.request.EventRequest request)
          Prepares this EventRequest with the current stored values.
 boolean createRequests(gj.util.Vector refTypes)
          Creates EventRequests corresponding to this DebugAction, using the given ReferenceTypes.
 String getClassName()
          Returns the class name this DebugAction occurs in.
 OpenDefinitionsDocument getDocument()
          Returns the document this DebugAction occurs in.
 File getFile()
          Returns the file this DebugAction occurs in.
 
Methods inherited from class edu.rice.cs.drjava.model.debug.DebugAction
_createRequests, _initializeRequests, _prepareRequests, createRequests, getLineNumber, getRequests
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_className

protected String _className

_file

protected File _file

_doc

protected OpenDefinitionsDocument _doc
Constructor Detail

DocumentDebugAction

public DocumentDebugAction(DebugManager manager,
                           OpenDefinitionsDocument doc,
                           int offset)
                    throws DebugException
Creates a new DocumentDebugAction. Automatically tries to create the EventRequest if a ReferenceType can be found, or else adds this object to the PendingRequestManager. Any subclass should automatically call _initializeRequest in its constructor.
Parameters:
manager - DebugManager in charge
doc - Document this action corresponds to
offset - Offset into the document that the action affects
Method Detail

getClassName

public String getClassName()
Returns the class name this DebugAction occurs in.

getFile

public File getFile()
Returns the file this DebugAction occurs in.

getDocument

public OpenDefinitionsDocument getDocument()
Returns the document this DebugAction occurs in.

createRequests

public boolean createRequests(gj.util.Vector refTypes)
                       throws DebugException
Creates EventRequests corresponding to this DebugAction, using the given ReferenceTypes. This is called either from the DebugAction constructor or the PendingRequestManager, depending on when the ReferenceTypes become available. (There may be multiple reference types for the same class if a custom class loader is used.)
Returns:
true if the EventRequest is successfully created

_initializeRequests

protected void _initializeRequests(gj.util.Vector refTypes)
                            throws DebugException
This should always be called from the constructor of the subclass. Attempts to create EventRequests on the given ReferenceTypes, and also adds this action to the pending request manager (so identical classes loaded in the future will also have this action).

_createRequests

protected abstract void _createRequests(gj.util.Vector refTypes)
                                 throws DebugException
Creates appropriate EventRequests from the EventRequestManager and stores them in the _requests field.
Parameters:
refTypes - All (identical) ReferenceTypes to which this action applies. (There may be multiple if a custom class loader is in use.)
Throws:
DebugException - if the requests could not be created.

_prepareRequest

protected void _prepareRequest(com.sun.jdi.request.EventRequest request)
Prepares this EventRequest with the current stored values.
Overrides:
_prepareRequest in class DebugAction
Parameters:
request - the EventRequest to prepare