Interface IMarkerManager

  • All Superinterfaces:
    IManagedService

    public interface IMarkerManager
    extends IManagedService
    A marker manager service.
    It provides operations with DT markers.

    Behind the scene the DT marker is associated with some EObject. From this point of view the DT marker is equivalent to Eclipse marker which is associated with some IResource.

    The marker manager manipulates with markers by the specified IProject, the given objectId and the given source.
    The objectId is an object of type string or long. It is caused as already mentioned by marker association with EObject.
    The marker-underlying EObject can be of type IBmObject or 'native' EObject.
    So we have two objectId types:

    The source string is an identifier of the source (origin) of markers. The source is a component that generates markers.

    See Also:
    Marker
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String SERVICE_NAME
      The name of the marker manager as managed service.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addListener​(org.eclipse.core.resources.IProject project, IMarkerManagerListener listener)
      Adds the specified listener for the given {code project}.
      IMarkerInfo getMarkerInfo​(org.eclipse.core.resources.IProject project)
      Returns marker info for the specified project.
      Marker[] getMarkers​(org.eclipse.core.resources.IProject project, Object objectId)
      Gets markers for the specified objectId and associated with the given project.
      MarkerSeverity getMaxSeverity​(org.eclipse.core.resources.IProject project, Object objectId)
      Finds and returns a maximum severity for the given objectId.
      Marker[] getNestedMarkers​(org.eclipse.core.resources.IProject project, Object objectId)
      Returns markers of the specified objectId and its children.
      Iterator<Marker> iterator​(org.eclipse.core.resources.IProject project)
      Returns an iterator over all the markers of the given project.
      void removeListener​(org.eclipse.core.resources.IProject project, IMarkerManagerListener listener)
      Removes the specified listener.
      void removeMarkers​(org.eclipse.core.resources.IProject project, Object objectId, String source)
      Removes markers for the specified objectId and source associated with the given project.
      void setMarkers​(org.eclipse.core.resources.IProject project, Object objectId, String source, Marker[] markers)
      Sets markers for the specified objectId and source associated with the given project.
      Iterator<Object> topObjectIdIterator​(org.eclipse.core.resources.IProject project)
      Returns an iterator over all top identifiers for objects with markers of the given project.
    • Method Detail

      • addListener

        void addListener​(org.eclipse.core.resources.IProject project,
                         IMarkerManagerListener listener)
        Adds the specified listener for the given {code project}.
        Parameters:
        project - the project to associate with the listener, cannot be null.
        listener - the listener to add, cannot be null.
        See Also:
        IMarkerManagerListener
      • removeListener

        void removeListener​(org.eclipse.core.resources.IProject project,
                            IMarkerManagerListener listener)
        Removes the specified listener.
        Parameters:
        project - the project, cannot be null.
        listener - the listener to remove, cannot be null.
        See Also:
        IMarkerManagerListener
      • setMarkers

        void setMarkers​(org.eclipse.core.resources.IProject project,
                        Object objectId,
                        String source,
                        Marker[] markers)
        Sets markers for the specified objectId and source associated with the given project.

        If the specified objectId is of Long type then it is supposed that markers array contains all markers including contained objects.

        If some markers already exist for the specified objectId and source they will be replaced by a new one.
        If the given markers array is null or empty, the existing markers for the specified objectId and source will be removed.

        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        source - the source, cannot be null.
        markers - the array of markers.
      • removeMarkers

        void removeMarkers​(org.eclipse.core.resources.IProject project,
                           Object objectId,
                           String source)
        Removes markers for the specified objectId and source associated with the given project.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        source - the source, cannot be null.
      • getMarkers

        Marker[] getMarkers​(org.eclipse.core.resources.IProject project,
                            Object objectId)
        Gets markers for the specified objectId and associated with the given project.

        It retrieves markers without filtering by 'source'. The client can filter if manually if needed.

        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        an array of markers, never null.
      • getNestedMarkers

        Marker[] getNestedMarkers​(org.eclipse.core.resources.IProject project,
                                  Object objectId)
        Returns markers of the specified objectId and its children.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        an array of markers for the specified objectId and its children, never null.
      • getMaxSeverity

        MarkerSeverity getMaxSeverity​(org.eclipse.core.resources.IProject project,
                                      Object objectId)
        Finds and returns a maximum severity for the given objectId.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        a maximum severity or null.
      • iterator

        Iterator<Marker> iterator​(org.eclipse.core.resources.IProject project)
        Returns an iterator over all the markers of the given project.
        Parameters:
        project - the project, cannot be null.
        Returns:
        iterator over all the markers, never null.
      • topObjectIdIterator

        Iterator<Object> topObjectIdIterator​(org.eclipse.core.resources.IProject project)
        Returns an iterator over all top identifiers for objects with markers of the given project.
        Parameters:
        project - the project, cannot be null.
        Returns:
        iterator over all the source ids for objects with markers, never null.
      • getMarkerInfo

        IMarkerInfo getMarkerInfo​(org.eclipse.core.resources.IProject project)
        Returns marker info for the specified project.
        Parameters:
        project - the project to get the marker info associated with, cannot be null.
        Returns:
        the marker info, never null.
        See Also:
        IMarkerInfo