Eclipse Platform
2.0

org.eclipse.debug.core.model
Class Breakpoint

java.lang.Object
  |
  +--org.eclipse.core.runtime.PlatformObject
        |
        +--org.eclipse.debug.core.model.Breakpoint
All Implemented Interfaces:
IAdaptable, IBreakpoint
Direct Known Subclasses:
LineBreakpoint

public abstract class Breakpoint
extends PlatformObject
implements IBreakpoint

Abstract implementation of a breakpoint. This class is intended to be subclassed by implementations of breakpoints.

Since:
2.0
See Also:
IBreakpoint

Field Summary
 
Fields inherited from interface org.eclipse.debug.core.model.IBreakpoint
BREAKPOINT_MARKER, ENABLED, ID, LINE_BREAKPOINT_MARKER, PERSISTED, REGISTERED
 
Constructor Summary
Breakpoint()
           
 
Method Summary
 void delete()
          Deletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.
protected  IMarker ensureMarker()
          Returns the marker associated with this breakpoint.
 boolean equals(Object item)
           
 IMarker getMarker()
          Returns the marker associated with this breakpoint, or null if no marker is associated with this breakpoint.
 int hashCode()
           
 boolean isEnabled()
          Returns whether this breakpoint is enabled
 boolean isPersisted()
          Returns whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened.
 boolean isRegistered()
          Returns whether this breakpoint is currently registered with the breakpoint manager.
protected  void setAttribute(String attributeName, boolean value)
          Convenience method to set the given boolean attribute of this breakpoint's underlying marker in a workspace runnable.
protected  void setAttribute(String attributeName, int value)
          Convenience method to set the given integer attribute of this breakpoint's underlying marker in a workspace runnable.
protected  void setAttribute(String attributeName, Object value)
          Convenience method to set the given attribute of this breakpoint's underlying marker in a workspace runnable.
protected  void setAttributes(Map attributes)
          Convenience method to set the attributes of this breakpoint's underlying marker in a workspace runnable.
protected  void setAttributes(String[] attributeNames, Object[] values)
          Convenience method to set the given attributes of this breakpoint's underlying marker in a workspace runnable.
 void setEnabled(boolean enabled)
          Sets the enabled state of this breakpoint.
 void setMarker(IMarker marker)
          Sets the marker associated with this breakpoint.
 void setPersisted(boolean persisted)
          Sets whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened.
 void setRegistered(boolean registered)
          Sets whether this breakpoint is currently registered with the breakpoint manager.
 
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.IBreakpoint
getModelIdentifier
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

Breakpoint

public Breakpoint()
Method Detail

setMarker

public void setMarker(IMarker marker)
               throws CoreException
Description copied from interface: IBreakpoint
Sets the marker associated with this breakpoint. This method is called once at breakpoint creation.

Specified by:
setMarker in interface IBreakpoint
Parameters:
marker - the marker to associate with this breakpoint
Throws:
CoreException - if an error occurs accessing the marker
See Also:
IBreakpoint.setMarker(IMarker)

equals

public boolean equals(Object item)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

setEnabled

public void setEnabled(boolean enabled)
                throws CoreException
Description copied from interface: IBreakpoint
Sets the enabled state of this breakpoint. This has no effect if the current enabled state is the same as specified by the enabled parameter.

Specified by:
setEnabled in interface IBreakpoint
Parameters:
enabled - whether this breakpoint should be enabled
Throws:
CoreException - if unable to set the associated attribute on this breakpoint's underlying marker.
See Also:
IBreakpoint.setEnabled(boolean)

isEnabled

public boolean isEnabled()
                  throws CoreException
Description copied from interface: IBreakpoint
Returns whether this breakpoint is enabled

Specified by:
isEnabled in interface IBreakpoint
Returns:
whether this breakpoint is enabled
Throws:
CoreException - if unable to access the associated attribute from this breakpoint's underlying marker
See Also:
IBreakpoint.isEnabled()

isRegistered

public boolean isRegistered()
                     throws CoreException
Description copied from interface: IBreakpoint
Returns whether this breakpoint is currently registered with the breakpoint manager.

Specified by:
isRegistered in interface IBreakpoint
Returns:
whether this breakpoint is currently registered with the breakpoint manager
Throws:
CoreException - if unable to access the associated attribute on this breakpoint's underlying marker
See Also:
IBreakpoint.isRegistered()

setRegistered

public void setRegistered(boolean registered)
                   throws CoreException
Description copied from interface: IBreakpoint
Sets whether this breakpoint is currently registered with the breakpoint manager.

Specified by:
setRegistered in interface IBreakpoint
Parameters:
registered - whether this breakpoint is registered with the breakpoint manager
Throws:
CoreException - if unable to set the associated attribute on this breakpoint's underlying marker.
See Also:
IBreakpoint.setRegistered(boolean)

delete

public void delete()
            throws CoreException
Description copied from interface: IBreakpoint
Deletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.

Specified by:
delete in interface IBreakpoint
Throws:
CoreException - if unable to delete this breakpoint's underlying marker
See Also:
IBreakpoint.delete()

getMarker

public IMarker getMarker()
Description copied from interface: IBreakpoint
Returns the marker associated with this breakpoint, or null if no marker is associated with this breakpoint.

Specified by:
getMarker in interface IBreakpoint
Returns:
associated marker, or null if there is no associated marker.
See Also:
IBreakpoint.getMarker()

isPersisted

public boolean isPersisted()
                    throws CoreException
Description copied from interface: IBreakpoint
Returns whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened. Since marker definitions only allow all/none of a specific type of marker to be persisted (rather than selected markers of a specific type), breakpoints define this functionality.

Specified by:
isPersisted in interface IBreakpoint
Returns:
whether this breakpoint is to be persisted
Throws:
CoreException - if unable to access the associated attribute on this breakpoint's underlying marker
See Also:
IBreakpoint.isPersisted()

setPersisted

public void setPersisted(boolean persisted)
                  throws CoreException
Description copied from interface: IBreakpoint
Sets whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened. Since marker definitions only allow all/none of a specific type of marker to be persisted (rather than selected markers of a specific type), breakpoints define this functionality. Has no effect if this breakpoint's marker definition is defined as not persisted.

Specified by:
setPersisted in interface IBreakpoint
Throws:
CoreException - if unable to set the associated attribute on this breakpoint's underlying marker.
See Also:
IBreakpoint.setPersisted(boolean)

setAttribute

protected void setAttribute(String attributeName,
                            boolean value)
                     throws CoreException
Convenience method to set the given boolean attribute of this breakpoint's underlying marker in a workspace runnable. Setting marker attributes in a workspace runnable prevents deadlock.

Parameters:
attributeName - attribute name
value - attribute value
Throws:
CoreException - is setting the attribute fails
See Also:
IMarker.setAttribute(java.lang.String, boolean)

setAttribute

protected void setAttribute(String attributeName,
                            int value)
                     throws CoreException
Convenience method to set the given integer attribute of this breakpoint's underlying marker in a workspace runnable. Setting marker attributes in a workspace runnable prevents deadlock.

Parameters:
attributeName - attribute name
value - attribute value
Throws:
CoreException - is setting the attribute fails
See Also:
IMarker.setAttribute(java.lang.String, int)

setAttribute

protected void setAttribute(String attributeName,
                            Object value)
                     throws CoreException
Convenience method to set the given attribute of this breakpoint's underlying marker in a workspace runnable. Setting marker attributes in a workspace runnable prevents deadlock.

Parameters:
attributeName - attribute name
value - attribute value
Throws:
CoreException - is setting the attribute fails
See Also:
IMarker.setAttribute(java.lang.String, java.lang.Object)

setAttributes

protected void setAttributes(String[] attributeNames,
                             Object[] values)
                      throws CoreException
Convenience method to set the given attributes of this breakpoint's underlying marker in a workspace runnable. Setting marker attributes in a workspace runnable prevents deadlock.

Parameters:
attributeNames - attribute names
values - attribute values
Throws:
CoreException - is setting the attributes fails
See Also:
IMarker.setAttributes(java.lang.String[], java.lang.Object[])

setAttributes

protected void setAttributes(Map attributes)
                      throws CoreException
Convenience method to set the attributes of this breakpoint's underlying marker in a workspace runnable. Setting marker attributes in a workspace runnable prevents deadlock.

Parameters:
attributes - attribute map
Throws:
CoreException - is setting the attributes fails
See Also:
IMarker.setAttributes(java.util.Map)

ensureMarker

protected IMarker ensureMarker()
                        throws DebugException
Returns the marker associated with this breakpoint.

Returns:
breakpoint marker
Throws:
DebugException - if no marker is associated with this breakpoint or the associated marker does not exist

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.