Community
Participate
Working Groups
build 20021114 The Java editor is using a LineBackgroundListener to set the regular widget background color. Each reveal of the editor results in one call to the listener for each visible line. This is wasting cycles. The editor should use setBackground to set the widget background color. The line background listener should be used exclusively for things like the line highlight. The plain text editor does not actually provide a line color but it still hooks a LineBackgroundListener and therefore uneccessary callbacks are made.
How do you see this behavior? The line background listener is only registered when a find/replace action is active.
I thinnk I put a System.out.println in StyledText.sendLineEvent and checked for LineGetBackground. I must have debugged this, too, since I noted different behavior in the Java editor vs. plain text editor.
Adding my name to the cc list as we are now tracking performance issues more closely. Please remove the performance keyword if this is not a performance bug.
What is the status of this?
We use the LineBackgroundListener for two reasons: - Find/Replace as mentioned in comment 1 - highlight the current line We don't use it to set the widget's background color. StyledText sends this event out for every visible line when the widget gets activated. There's not much we can do about this didn't show up in any of our performance traces so far.
Is the StyledText behavior (i.e. send it for every visible line on activate) actually required? If not, and the changes are reasonable, it should be removed even if the performance hit isn't enough to be seen. (As you make everything else faster, you'll notice it eventually)
Steve, can you or someone from the SWT team answer Mike's last question?
Adding Felipe because he owns StyledText.
>>StyledText sends this event out for every visible line when the widget >>gets activated. There's not much we can do about this didn't show up >>in any of our performance traces so far. This sounds right. The listener allows you to color a line at a time and can't know that you won't color a line. Felipe?
Ah... I get it. The *event* is sent out, but no background painting is done in the current code. Sorry for being dense.