com.aptana.ide.debug.internal.core.model
Class JSDebugLineBreakpoint

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.debug.core.model.Breakpoint
          extended by org.eclipse.debug.core.model.LineBreakpoint
              extended by com.aptana.ide.debug.internal.core.model.JSDebugLineBreakpoint
All Implemented Interfaces:
IJSLineBreakpoint, org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.model.IBreakpoint, org.eclipse.debug.core.model.ILineBreakpoint

public class JSDebugLineBreakpoint
extends org.eclipse.debug.core.model.LineBreakpoint
implements IJSLineBreakpoint

Author:
Max Stepanov

Field Summary
 
Fields inherited from interface org.eclipse.debug.core.model.IBreakpoint
BREAKPOINT_MARKER, ENABLED, ID, LINE_BREAKPOINT_MARKER, PERSISTED, REGISTERED
 
Constructor Summary
JSDebugLineBreakpoint()
          Default constructor is required for the breakpoint manager to re-create persisted breakpoints.
JSDebugLineBreakpoint(org.eclipse.core.resources.IResource resource, int lineNumber)
          Constructs a line breakpoint on the given resource at the given line number.
JSDebugLineBreakpoint(org.eclipse.core.resources.IResource resource, int lineNumber, java.util.Map attributes, boolean register)
          Constructs a line breakpoint on the given resource at the given line number.
JSDebugLineBreakpoint(IUniformResource resource, int lineNumber)
          JSDebugLineBreakpoint
JSDebugLineBreakpoint(IUniformResource resource, int lineNumber, java.util.Map attributes, boolean register)
          JSDebugLineBreakpoint
 
Method Summary
 java.lang.String getCondition()
          Returns the conditional expression associated with this breakpoint, or null if this breakpoint does not have a condition.
 int getHitCount()
          Returns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.
 java.lang.String getModelIdentifier()
           
 boolean isConditionEnabled()
          Returns whether the condition on this breakpoint is enabled.
 boolean isConditionSuspendOnTrue()
          Returns whether the breakpoint suspends when the value of the condition is true or when the value of the condition changes.
 boolean isRunToLine()
          isRunToLine
 void setCondition(java.lang.String condition)
          Sets the condition associated with this breakpoint.
 void setConditionEnabled(boolean enabled)
          Sets the enabled state of this breakpoint's condition to the given state.
 void setConditionSuspendOnTrue(boolean suspendOnTrue)
          Set the suspend state of this breakpoint's condition.
 void setHitCount(int count)
          Sets the hit count attribute of this breakpoint.
 
Methods inherited from class org.eclipse.debug.core.model.LineBreakpoint
getCharEnd, getCharStart, getLineNumber
 
Methods inherited from class org.eclipse.debug.core.model.Breakpoint
delete, ensureMarker, equals, getMarker, getMarkerRule, getMarkerRule, hashCode, isEnabled, isPersisted, isRegistered, markerExists, run, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setEnabled, setMarker, setPersisted, setRegistered
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.debug.core.model.ILineBreakpoint
getCharEnd, getCharStart, getLineNumber
 
Methods inherited from interface org.eclipse.debug.core.model.IBreakpoint
delete, getMarker, isEnabled, isPersisted, isRegistered, setEnabled, setMarker, setPersisted, setRegistered
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

JSDebugLineBreakpoint

public JSDebugLineBreakpoint()
Default constructor is required for the breakpoint manager to re-create persisted breakpoints. After instantiating a breakpoint, the setMarker(...) method is called to restore this breakpoint's attributes.


JSDebugLineBreakpoint

public JSDebugLineBreakpoint(org.eclipse.core.resources.IResource resource,
                             int lineNumber)
                      throws org.eclipse.core.runtime.CoreException
Constructs a line breakpoint on the given resource at the given line number. The line number is 1-based (i.e. the first line of a file is line number 1).

Parameters:
resource - file on which to set the breakpoint
lineNumber - 1-based line number of the breakpoint
Throws:
org.eclipse.core.runtime.CoreException - if unable to create the breakpoint

JSDebugLineBreakpoint

public JSDebugLineBreakpoint(IUniformResource resource,
                             int lineNumber)
                      throws org.eclipse.core.runtime.CoreException
JSDebugLineBreakpoint

Parameters:
resource -
lineNumber -
Throws:
org.eclipse.core.runtime.CoreException

JSDebugLineBreakpoint

public JSDebugLineBreakpoint(org.eclipse.core.resources.IResource resource,
                             int lineNumber,
                             java.util.Map attributes,
                             boolean register)
                      throws org.eclipse.core.runtime.CoreException
Constructs a line breakpoint on the given resource at the given line number. The line number is 1-based (i.e. the first line of a file is line number 1).

Parameters:
resource - file on which to set the breakpoint
lineNumber - 1-based line number of the breakpoint
attributes - the marker attributes to set
register - whether to add this breakpoint to the breakpoint manager
Throws:
org.eclipse.core.runtime.CoreException - if unable to create the breakpoint

JSDebugLineBreakpoint

public JSDebugLineBreakpoint(IUniformResource resource,
                             int lineNumber,
                             java.util.Map attributes,
                             boolean register)
                      throws org.eclipse.core.runtime.CoreException
JSDebugLineBreakpoint

Parameters:
resource -
lineNumber -
attributes -
register -
Throws:
org.eclipse.core.runtime.CoreException
Method Detail

getModelIdentifier

public java.lang.String getModelIdentifier()
Specified by:
getModelIdentifier in interface org.eclipse.debug.core.model.IBreakpoint
See Also:
IBreakpoint.getModelIdentifier()

isRunToLine

public boolean isRunToLine()
                    throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
isRunToLine

Specified by:
isRunToLine in interface IJSLineBreakpoint
Returns:
whether this breakpoint is a run to line breakpoint
Throws:
org.eclipse.core.runtime.CoreException

getHitCount

public int getHitCount()
                throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Returns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.

Specified by:
getHitCount in interface IJSLineBreakpoint
Returns:
this breakpoint's hit count, or -1
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property from this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.getHitCount()

setHitCount

public void setHitCount(int count)
                 throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Sets the hit count attribute of this breakpoint. If this breakpoint is currently disabled and the hit count is set greater than -1, this breakpoint is automatically enabled.

Specified by:
setHitCount in interface IJSLineBreakpoint
Parameters:
count - the new hit count
Throws:
org.eclipse.core.runtime.CoreException - if unable to set the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.setHitCount(int)

getCondition

public java.lang.String getCondition()
                              throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Returns the conditional expression associated with this breakpoint, or null if this breakpoint does not have a condition.

Specified by:
getCondition in interface IJSLineBreakpoint
Returns:
this breakpoint's conditional expression, or null
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.getCondition()

setCondition

public void setCondition(java.lang.String condition)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Sets the condition associated with this breakpoint. When the condition is enabled, this breakpoint will only suspend execution when the given condition evaluates to true. Setting the condition to null or an empty string removes the condition.

If this breakpoint does not support conditions, setting the condition has no effect.

Specified by:
setCondition in interface IJSLineBreakpoint
Parameters:
condition - conditional expression
Throws:
org.eclipse.core.runtime.CoreException - if unable to set the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.setCondition(java.lang.String)

isConditionEnabled

public boolean isConditionEnabled()
                           throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Returns whether the condition on this breakpoint is enabled.

Specified by:
isConditionEnabled in interface IJSLineBreakpoint
Returns:
whether this breakpoint's condition is enabled
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.isConditionEnabled()

setConditionEnabled

public void setConditionEnabled(boolean enabled)
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Sets the enabled state of this breakpoint's condition to the given state. When enabled, this breakpoint will only suspend when its condition evaluates to true. When disabled, this breakpoint will suspend as it would with no condition defined.

Specified by:
setConditionEnabled in interface IJSLineBreakpoint
Throws:
org.eclipse.core.runtime.CoreException - if unable to set the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.setConditionEnabled(boolean)

isConditionSuspendOnTrue

public boolean isConditionSuspendOnTrue()
                                 throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Returns whether the breakpoint suspends when the value of the condition is true or when the value of the condition changes.

Specified by:
isConditionSuspendOnTrue in interface IJSLineBreakpoint
Returns:
true if this breakpoint suspends when the value of the condition is true, false if this breakpoint suspends when the value of the condition changes.
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.isConditionSuspendOnTrue()

setConditionSuspendOnTrue

public void setConditionSuspendOnTrue(boolean suspendOnTrue)
                               throws org.eclipse.core.runtime.CoreException
Description copied from interface: IJSLineBreakpoint
Set the suspend state of this breakpoint's condition. If the value is true, the breakpoint will stop when the value of the condition is true. If the value is false, the breakpoint will stop when the value of the condition changes.

Specified by:
setConditionSuspendOnTrue in interface IJSLineBreakpoint
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker
See Also:
IJSLineBreakpoint.setConditionSuspendOnTrue(boolean)