Class MarkerViewUtil


  • public class MarkerViewUtil
    extends Object
    Utility class for showing markers in the marker views.
    • Constructor Detail

      • MarkerViewUtil

        public MarkerViewUtil()
    • Method Detail

      • getViewId

        public static String getViewId​(IMarker marker)
                                throws CoreException
        Returns the id of the view used to show markers of the same type as the given marker.
        Parameters:
        marker - the marker
        Returns:
        the view id or null if no appropriate view could be determined
        Throws:
        CoreException - if an exception occurs testing the type of the marker
        Since:
        3.0
      • showMarker

        public static boolean showMarker​(IWorkbenchPage page,
                                         IMarker marker,
                                         boolean showView)
        Shows the given marker in the appropriate view in the given page. This must be called from the UI thread.
        Parameters:
        page - the workbench page in which to show the marker
        marker - the marker to show
        showView - true if the view should be shown first false to only show the marker if the view is already showing
        Returns:
        true if the marker was successfully shown, false if not
        Since:
        3.0
      • showMarkers

        public static boolean showMarkers​(IWorkbenchPage page,
                                          IMarker[] markers,
                                          boolean showView)
        Shows the given markers in the appropriate view for the first marker in the given page. If following markers do not belong to this view, they would not be shown. This must be called from the UI thread.
        Parameters:
        page - the workbench page in which to show the markers
        markers - the markers to show
        showView - true if the view should be shown first false to only show the markers if the view is already showing
        Returns:
        true if the markers were successfully shown, false if not
        Since:
        3.13