Community
Participate
Working Groups
Created attachment 232768 [details] proposed patch When using the VPG Browser (Refactor menu -> VPG Browser) and viewing the Annotations tab, attempting to scroll the file's text will feel slow to the user if the file has a large number of annotations. If a token has an annotation it will have a box drawn around it and the slow scrolling is due to the way those boxes are drawn. The current method of using the RectanglePainter (custom class implementing PaintListener) causes every box to be drawn around every token whenever the file's text area needs to be refreshed (this includes whenever the cursor flashes in the text area! ). Specifically, the drawRectangle method's use of StyledText.getTextBounds prevents the RectanglePainter from keeping up with any amount of scrolling if a file has a large number of annotations. Instead of re-drawing the annotation-indicating boxes each time the file's text area needs to be refreshed, the AnnotationsTab class should use the StyleRange aspect of the StyledText class. I confirm that: (a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others (b) I have the right to contribute the code to Eclipse (c) I have included the EPL license header in all source files.
Created attachment 233057 [details] updated proposed patch This updated proposed patch is a lot less complex and still performs much better than the current implementation. This patch leaves the RectanglePainter in place but only attempts to paint a rectangle if it is in the text widget's visible area.
Created attachment 233058 [details] updated proposed patch This updated patch is a lot less complex and still performs much better than the current implementation. This patch leaves the RectanglePainter in place but only attempts to paint a rectangle if it is in the text widget's visible area. I confirm that: (a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others (b) I have the right to contribute the code to Eclipse (c) I have included the EPL license header in all source files.