Adding markers synchronously to file [message #1359919] |
Fri, 16 May 2014 15:18 |
|
Hello!
I am trying to figure out how to add two sets of annotation markers to file in a synchronous way. Specifically I'm adding annotation markers which show up like text highlighting (imagine a code coverage tool with red and green highlighting for touched/untouched code).
The problem is that my sets of markers (say red and green) sometimes overlap. I want to make sure the red ones are added last, so they appear on top of the green ones. Is it possible to make overlapping markers work properly? The loops adding the markers are running in the UI thread (but apparently the underlying way Eclipse adds the markers is still asynchronous).
In pseudecode:
for(Node n : toBeGreen) {
IMarker m = file.createMarker(markerType);
m.setAttribute(IMarker.CHAR_START, n.start);
m.setAttribute(IMarker.CHAR_END, n.end);
}
for(Node n : toBeRed) {
IMarker m = file.createMarker(markerType);
m.setAttribute(IMarker.CHAR_START, n.start);
m.setAttribute(IMarker.CHAR_END, n.end);
}
The result is that the individual green and red markers just get added sporadically over a couple seconds (there are lots of nodes), sometimes with red on top sometimes green. I also tried putting these loops inside Display.syncExec functions, but that didn't make a difference (which is logical, since this is already UI thread).
Any ideas? Thanks for any help!
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.03619 seconds