Markers are a general mechanism for associating notes and meta-data with resources.
Markers themselves are handles in the same way as IResources
are handles. Instances of IMarker
do not hold the attributes themselves but rather uniquely refer to the attribute container. As such, their state may change underneath the handle with no warning to the holder of the handle.
The Resources plug-in provides a general framework for defining and manipulating markers and provides several standard marker types.
Each marker has:
- a type string, specifying its type (e.g.
"org.eclipse.core.resources.taskmarker"
), - an identifier which is unique (relative to a particular resource)
Specific types of markers may carry additional information.
The resources plug-in defines five standard types:
org.eclipse.core.resources.marker
org.eclipse.core.resources.taskmarker
org.eclipse.core.resources.problemmarker
org.eclipse.core.resources.bookmark
org.eclipse.core.resources.textmarker
The plug-in also provides an extension point (
org.eclipse.core.resources.markers
) into which other plug-ins can install marker type declaration extensions.
Marker types are declared within a multiple inheritance type system. New markers are defined in the plugin.xml
file of the declaring plug-in. A valid declaration contains elements as defined by the extension point DTD:
- type - the unique name of the marker type
- super - the list of marker types of which this marker is to be considered a sub-type
- attributes - the list of standard attributes which may be present on this type of marker
- persistent - whether markers of this type should be persisted by the platform
All markers declared as persistent
are saved when the workspace is saved, except those explicitly set as transient (the TRANSIENT
attribute is set as true
). A plug-in which defines a persistent marker is not directly involved in saving and restoring the marker. Markers are not under version and configuration management, and cannot be shared via VCM repositories.
This interface is not intended to be implemented by developers.
Markers implement the IAdaptable
interface; extensions are managed by the platform's adapter manager.