Interface IBreakpoint
- All Superinterfaces:
IAdaptable
- All Known Subinterfaces:
ILineBreakpoint
,IWatchpoint
- All Known Implementing Classes:
Breakpoint
,LineBreakpoint
A breakpoint is defined in two parts:
- By an extension of kind
"org.eclipse.debug.core.breakpoints"
- By a marker definition that corresponds to the above breakpoint extension
For example, following is a definition of corresponding breakpoint
and breakpoint marker definitions. Note that the markerType
attribute defined by the breakpoint extension corresponds to the
type of the marker definition.
<extension point="org.eclipse.debug.core.breakpoints"> <breakpoint id="com.example.Breakpoint" class="com.example.Breakpoint" markerType="com.example.BreakpointMarker"> </breakpoint> </extension> <extension point="org.eclipse.core.resources.markers" id="com.example.BreakpointMarker" name="Example Breakpoint"> <super type="org.eclipse.debug.core.breakpointMarker"/> <attribute name="exampleAttribute"/> </extension>
The breakpoint manager instantiates persisted breakpoints by
traversing all markers that are a subtype of
"org.eclipse.debug.core.breakpointMarker"
, and
instantiating the class defined by the class
attribute
on the associated breakpoint extension. The method setMarker
is then called to associate a marker with the breakpoint.
Breakpoints may or may not be registered with the breakpoint manager, and
are persisted and restored as such. Since marker definitions only allow
all or none of a specific marker type to be persisted, breakpoints define
a PERSISTED
attribute for selective persistence of breakpoints
of the same type.
- Since:
- 2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Root breakpoint marker type (value"org.eclipse.debug.core.breakpointMarker"
).static final String
Enabled breakpoint marker attribute (value"org.eclipse.debug.core.enabled"
).static final String
Debug model identifier breakpoint marker attribute (value"org.eclipse.debug.core.id"
).static final String
Line breakpoint marker type (value"org.eclipse.debug.core.lineBreakpoint"
).static final String
Persisted breakpoint marker attribute (value"org.eclipse.debug.core.persisted"
).static final String
Registered breakpoint marker attribute (value"org.eclipse.debug.core.registered"
). -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Deletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.Returns the marker associated with this breakpoint, ornull
if no marker is associated with this breakpoint.Returns the identifier of the debug model this breakpoint is associated with.boolean
Returns whether this breakpoint is enabledboolean
Returns whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened.boolean
Returns whether this breakpoint is currently registered with the breakpoint manager.void
setEnabled
(boolean enabled) Sets the enabled state of this breakpoint.void
Sets the marker associated with this breakpoint.void
setPersisted
(boolean registered) 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 interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Field Details
-
BREAKPOINT_MARKER
Root breakpoint marker type (value"org.eclipse.debug.core.breakpointMarker"
). -
LINE_BREAKPOINT_MARKER
Line breakpoint marker type (value"org.eclipse.debug.core.lineBreakpoint"
). -
ENABLED
Enabled breakpoint marker attribute (value"org.eclipse.debug.core.enabled"
). The attribute is aboolean
corresponding to the enabled state of a breakpoint. -
ID
Debug model identifier breakpoint marker attribute (value"org.eclipse.debug.core.id"
). The attribute is aString
corresponding to the identifier of the debug model a breakpoint is associated with.- See Also:
-
REGISTERED
Registered breakpoint marker attribute (value"org.eclipse.debug.core.registered"
). The attribute is aboolean
corresponding to whether a breakpoint has been registered with the breakpoint manager. -
PERSISTED
Persisted breakpoint marker attribute (value"org.eclipse.debug.core.persisted"
). The attribute is aboolean
corresponding to whether a breakpoint is to be persisted across workspace invocations.
-
-
Method Details
-
delete
Deletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.- Throws:
CoreException
- if unable to delete this breakpoint's underlying marker
-
getMarker
IMarker getMarker()Returns the marker associated with this breakpoint, ornull
if no marker is associated with this breakpoint.- Returns:
- associated marker, or
null
if there is no associated marker.
-
setMarker
Sets the marker associated with this breakpoint. This method is called once at breakpoint creation.- Parameters:
marker
- the marker to associate with this breakpoint- Throws:
CoreException
- if an error occurs accessing the marker
-
getModelIdentifier
String getModelIdentifier()Returns the identifier of the debug model this breakpoint is associated with.- Returns:
- the identifier of the debug model this breakpoint is associated with
-
isEnabled
Returns whether this breakpoint is enabled- Returns:
- whether this breakpoint is enabled
- Throws:
CoreException
- if unable to access the associated attribute from this breakpoint's underlying marker
-
setEnabled
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.- Parameters:
enabled
- whether this breakpoint should be enabled- Throws:
CoreException
- if unable to set the associated attribute on this breakpoint's underlying marker.
-
isRegistered
Returns whether this breakpoint is currently registered with the breakpoint manager.- 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
-
setRegistered
Sets whether this breakpoint is currently registered with the breakpoint manager.- 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.
-
isPersisted
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.- Returns:
- whether this breakpoint is to be persisted
- Throws:
CoreException
- if unable to access the associated attribute on this breakpoint's underlying marker
-
setPersisted
Sets whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened. Has no effect if this breakpoint's marker definition is defined as not persisted. Sets the underlyingTRANSIENT
attribute on this breakpoint's marker totrue
.- Parameters:
registered
- whether this breakpoint is to be persisted across workspace invocations- Throws:
CoreException
- if unable to set the associated attribute on this breakpoint's underlying marker.
-