Markers in the Eclipse IDE

Markers created using the org.eclipse.core.resources.markers support can be shown in the user interface using the org.eclipse.ui.ide.markerHelp, org.eclipse.ui.ide.markerResolution and org.eclipse.ui.ide.markerSupport extension points. The org.eclipse.ui.ide.markerImageProvider API is internal of release 3.2.

org.eclipse.ui.ide.markerHelp

org.eclipse.ui.ide.markerHelp is the extension point that allows you to associate a help context with your marker type.

org.eclipse.ui.ide.markerResolution

org.eclipse.ui.ide.markerResolution is the extension point that allows you to contribute Quick Fixes for markers. The Java Editor and the Problems View are two places where these can be applied currently. This extension point allows the plug-in developer to specify the IMarkerResolutionGenerator that can determine the possible resolutions to a marker.

As of release 3.2 the Problems View supports multiple resolutions allowing the user to add other matching problems to the list of problems to fix and applying the selected fix to all of them at once. If IMarkerResolutions are instances of WorkbenchMarkerResolution it is possible for users to add other matching WorkbenchMarkerResolutions in the Quick Fix dialog.

Picture of the quick fix dialog

Quick Fix dialog with two missing externalizations

org.eclipse.ui.ide.markerSupport

org.eclipse.ui.ide.markerSupport is the extension for specifying how markers are displayed in the Problems View. This extension point handles filters and grouping.

Filters

As of Eclipse 3.2 the Problems View handles multiple filters. Note that these filters sum their results rather than find their union. New filters can be added using the problemFilter extension element or manually by the user. Below is the filters section of the Problems View showing user filters and filters added via the extension point (system filters).

Picture of the problems view filter dialog

Grouped

Markers can be grouped into two ways. The first way is to group marker types into groups using the markerTypeCategory extension. This is shown when the user selects Group By - > Type. Below is an example showing Java Problems and some using a test grouping.

Picture of grouping the problems view by type

When marker types are grouped together they will be shown in those groups in the filters dialog.

Picture of grouping the problems view by category

It is also possible to create your own grouping using the markerGrouping extension which will show up as an extra entry in the Group By->Menu of the Problems view. The IDE provides a grouping based on severity (the default). JDT provides a Java Type grouping as well in the SDK.

markerGroupings are resolved by checking attributes on the IMarker. markerAttributeMappings are used to specify these mappings. Below is the Group By menu with the extra markerGroupings that have been added. The Problems view is currently grouped by severity.

Picture of the Problems View Group By menu