I have a special editor with problem markers. Markers are displayed correctly in the problem view using the icon, location, and text, and problem icons are displayed correctly in the left margin of the editor.
I would like to display the same error message text in a popup when I hovered over the problem marker icon on the border, as it does in the Java editor. There are no pop-ups right now.
Is there an easy way to achieve this?
Answer:
OK, it seems that the functionality is built into the marker system. It seems that the patch has been sent, so it will probably be added to a later version, but before that it is also quite easy to create manually.
- Create a class that implements
IAnnotationHoverand implements getHoverInfo(). - Returns the class in method
getAnnotationHover()c SourceViewerConfiguration. - In the
getHoverInfo()method, call ISourceViewer.getAnnotationModel().getAnnotationIterator()to get all the tokens. - Select the marker (s) corresponding to the line number, and return the marker text.
source
share