Class Breakpoint

    • Constructor Summary

      Constructors 
      Constructor Description
      Breakpoint()
      Creates a breakpoint.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      protected ISchedulingRule getMarkerRule()
      Returns a scheduling rule to use when modifying or deleting this breakpoint's marker, possibly null.
      protected ISchedulingRule getMarkerRule​(IResource resource)
      Returns a scheduling rule to use when modifying markers on the given resource, possibly null.
      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.
      boolean isTriggerPoint()
      Returns whether this breakpoint is defined as a trigger point in the workspace.
      protected boolean markerExists()
      Returns whether this breakpoint has an associated marker that exists.
      protected void run​(ISchedulingRule rule, IWorkspaceRunnable wr)
      Execute the given workspace runnable with the scheduling rule to use when running the operation.
      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​(String[] attributeNames, Object[] values)
      Convenience method to set the given attributes of this breakpoint's underlying marker in a workspace runnable.
      protected void setAttributes​(Map<String,​? extends Object> attributes)
      Convenience method to set the 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.
      void setTriggerPoint​(boolean triggerPoint)
      Sets whether this breakpoint is to be treated as a trigger point for the workspace.
      String toString()  
    • Constructor Detail

      • Breakpoint

        public Breakpoint()
        Creates a breakpoint.
        Since:
        3.8
    • Method Detail

      • 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)
      • 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)
      • 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. Has no effect if this breakpoint's marker definition is defined as not persisted. Sets the underlying TRANSIENT attribute on this breakpoint's marker to true.
        Specified by:
        setPersisted in interface IBreakpoint
        Parameters:
        persisted - 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.
        See Also:
        IBreakpoint.setPersisted(boolean)
      • isTriggerPoint

        public boolean isTriggerPoint()
                               throws CoreException
        Description copied from interface: ITriggerPoint
        Returns whether this breakpoint is defined as a trigger point in the workspace.
        Specified by:
        isTriggerPoint in interface ITriggerPoint
        Returns:
        whether this breakpoint is a trigger point
        Throws:
        CoreException - if unable to access the associated attribute on this breakpoint's underlying marker
        Since:
        3.11
        See Also:
        IBreakpoint.isPersisted()
      • setTriggerPoint

        public void setTriggerPoint​(boolean triggerPoint)
                             throws CoreException
        Description copied from interface: ITriggerPoint
        Sets whether this breakpoint is to be treated as a trigger point for the workspace. If it is a trigger point, then the ITriggerPoint attribute on this breakpoint's marker is set to true.
        Specified by:
        setTriggerPoint in interface ITriggerPoint
        Parameters:
        triggerPoint - whether this breakpoint is to be treated as trigger point for the workspace
        Throws:
        CoreException - if unable to set the associated attribute on this breakpoint's underlying marker.
        Since:
        3.11
        See Also:
        ITriggerPoint.setTriggerPoint(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​(Map<String,​? extends Object> 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
      • markerExists

        protected boolean markerExists()
        Returns whether this breakpoint has an associated marker that exists.
        Returns:
        returns whether this breakpoint has an associated marker that exists
        Since:
        2.1
      • getMarkerRule

        protected ISchedulingRule getMarkerRule​(IResource resource)
        Returns a scheduling rule to use when modifying markers on the given resource, possibly null.
        Parameters:
        resource - a resource on which a marker will be created, modified, or deleted
        Returns:
        a scheduling rule to use when modifying markers on the given resource possibly null
        Since:
        3.1
      • getMarkerRule

        protected ISchedulingRule getMarkerRule()
        Returns a scheduling rule to use when modifying or deleting this breakpoint's marker, possibly null. This method is only valid when this breakpoint's marker has already been created. When creating a marker on a specific resource, use getMarkerRule(IResource) instead.
        Returns:
        a scheduling rule to use when modifying or deleting this breakpoint's marker
        Since:
        3.1
      • run

        protected void run​(ISchedulingRule rule,
                           IWorkspaceRunnable wr)
                    throws DebugException
        Execute the given workspace runnable with the scheduling rule to use when running the operation.
        Parameters:
        rule - the rule to use when running the operation
        wr - the runnable operation
        Throws:
        DebugException - If a core exception occurs performing the operation
        Since:
        3.1