SourceBreakpoint Class

com.bea.ide.sourceeditor.driver
SourceBreakpoint Class

public class SourceBreakpoint

    extends DefaultBreakpoint
    implements ISourceBreakPoint

This class provides an implementation of ISourceBreakPoint, and handles basic functionality like setting focus to the correct point in code when a breakpoint is hit and sending the breakpoint to server.


Hierarchy
Object
  DefaultBreakpoint
    SourceBreakpoint
All Implemented Interfaces

IDebugBreakPoint, ISourceBreakPoint, Serializable
Direct Known Subclasses

JavaBreakpoint, JavaMethodBreakpoint

Nested Class Summary

public static classSourceBreakpoint.DefaultLine
           Simple implementation of ISourceModel.Line that wraps around an element in the source, which may span multiple lines in the document.

Field Summary

protected transient ISourceDocument
_doc
The document itself, set when the document is loaded
protected URI
_file
URI to the file
protected transient ISourceModel.Line
_line
Line object on the document's model, used to track line number changes, set when the document is loaded
protected int
_lineNum
Line number on which the breakpoint is set
protected transient ISourceModel
_model
The document's model, set when the document is loaded
   
Fields from  com.bea.ide.debug.DefaultBreakpoint
_fDisabled, _id, _message, _properties, _propertyChangeSupport
 
Fields from interface com.bea.ide.debug.IDebugBreakPoint
BP_PROP_CONDITION, INVALID_ID, PROP_ERROR_MESSAGE
 
Fields from interface com.bea.ide.debug.ISourceBreakPoint
PROP_LINE_NUMBER
 

Constructor Summary

SourceBreakpoint(IDocument file, int line)

Creates a source breakpoint and associates it with a line number.
SourceBreakpoint(IDocument file)

Creates a source breakpoint but does not yet associate it with a line number.
 

Method Summary

public IDebugInstructionPoint
breakpointHit()
This is called when the breakpoint gets hit.
public void
documentLoaded()
In init, this breakpoint is about to be associated with an actual file.
public void
documentUnloaded()
In the case that a file is going away, we need to make sure to persist the current offset info.
public ISourceDocument
getCachedDocument()
Gets the document represented by this breakpoint.
public String
getExtension()
In general, returns the file's extension, but this implementation always returns null
public IDocument
getFile()
Grabs the document from the DocumentSvc based on the breakpoint's URI
public int
getLine()
Gets the line number for this break point.
public URI
getURI()
Gets the URI for the IDocument this breakpoint is set in.
public void
reset(Element elt)
public void
syncBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
This is called to have the Breakpoint synchronize itself with the proxy.
public String
toString()
Forces all Breakpoints to override toString.
public void
updateLine()
Re-syncs the line information with the underlying document
 
Methods from  com.bea.ide.debug.DefaultBreakpoint
clearBreakpoint, disable, getErrorMessage, getId, getProperties, getProperty, isDisabled, isValid, setErrorMessage, setId, setProperties, setProperty, supportsProperty,
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.ide.debug.IDebugBreakPoint
breakpointHit, clearBreakpoint, disable, getErrorMessage, getId, getProperties, getProperty, isDisabled, isValid, setErrorMessage, setId, setProperties, setProperty, supportsProperty, syncBreakpoint
 
Methods from interface com.bea.ide.debug.ISourceBreakPoint
documentLoaded, documentUnloaded, getCachedDocument, getLine, getURI, updateLine
 

Field Detail

_doc

protected transient ISourceDocument _doc
The document itself, set when the document is loaded


_file

protected URI _file
URI to the file


_line

protected transient ISourceModel.Line _line
Line object on the document's model, used to track line number changes, set when the document is loaded


_lineNum

protected int _lineNum
Line number on which the breakpoint is set


_model

protected transient ISourceModel _model
The document's model, set when the document is loaded

 

Constructor Detail

SourceBreakpoint

public SourceBreakpoint(IDocument file, 
                        int line)
Creates a source breakpoint and associates it with a line number.

SourceBreakpoint

protected SourceBreakpoint(IDocument file)
Creates a source breakpoint but does not yet associate it with a line number.
 

Method Detail

breakpointHit() Method

public IDebugInstructionPoint breakpointHit()
Description copied from IDebugBreakPoint.breakpointHit()
This is called when the breakpoint gets hit. This should take care of any processing that is needed when a breakpoint is hit. Normally, this will entail bringing the file to the forground, jumping to the current line, and setting an instruction point at the correct place.

Returns

the new instruction point, or null if this breakpoint doesn't know how to display itself, like an exception breakpoint

documentLoaded() Method

public void documentLoaded()
In init, this breakpoint is about to be associated with an actual file. So we open the file, and grab an element to tie it to a particular line.


documentUnloaded() Method

public void documentUnloaded()
In the case that a file is going away, we need to make sure to persist the current offset info.


getCachedDocument() Method

public ISourceDocument getCachedDocument()
Description copied from ISourceBreakPoint.getCachedDocument()
Gets the document represented by this breakpoint. This will return NULL if the breakpoint is not loaded, or if it does not have a reference to the document.

Returns

returns a reference to the document represented by the breakpoint if currently available.

getExtension() Method

public String getExtension()
In general, returns the file's extension, but this implementation always returns null

Returns

null

getFile() Method

public IDocument getFile()
Grabs the document from the DocumentSvc based on the breakpoint's URI

Returns

the document as returned from the DocumentSvc

getLine() Method

public int getLine()
Description copied from ISourceBreakPoint.getLine()
Gets the line number for this break point. If a line number doesn't make sense for this breakpoint, the breakpoint should return some unique int that describes its position in the document. The document's IDebugDriver must understand the int.

Returns

a unique value describing the line the breakpoint is on

getURI() Method

public URI getURI()
Description copied from ISourceBreakPoint.getURI()
Gets the URI for the IDocument this breakpoint is set in.

Returns

a URI that describes the document this breakpoint is in. You can get the IDocument for this URI via the DocumentSvc.

reset(Element) Method

public void reset(Element elt)

syncBreakpoint(IDebugBreakPoint.IBreakpointContext) Method

public void syncBreakpoint(IDebugBreakPoint.IBreakpointContext dbgCmds)
throws DebugTransportException
Description copied from IDebugBreakPoint.syncBreakpoint(IDebugBreakPoint.IBreakpointContext)
This is called to have the Breakpoint synchronize itself with the proxy. This function will be called for each breakpoint as a debugging session begins. It will also be called right after a breakpoint is set, for each project that contains the breakpoint.

Parameters

dbgCmds
this is an IDebugBreakPoint.IBreakpointContext object that provides the context needed to be the breakpoint to communicate with the target VM.

Exceptions

DebugTransportException

toString() Method

public String toString()
Description copied from DefaultBreakpoint.toString()
Forces all Breakpoints to override toString.

Overrides
DefaultBreakpoint.toString()

Returns

something reasonable for the breakpoint view to display

updateLine() Method

public void updateLine()
Description copied from ISourceBreakPoint.updateLine()
Re-syncs the line information with the underlying document