package bluej.editor.moe;
import bluej.Config;
import bluej.prefmgr.PrefMgr;
import bluej.utility.javafx.FXPlatformRunnable;
import bluej.utility.javafx.JavaFXUtil;
import threadchecker.OnThread;
import threadchecker.Tag;
| Process the document re-parse queue.
|
| <p>This is a Runnable which runs on the Swing/AWT event queue. It performs
| a small amount of re-parsing before re-queing itself, which allows input
| to be processed in the meantime.
|
| @author Davin McCall
|
@OnThread(value = Tag.FXPlatform, ignoreParent = true)
public class ReparseRunner
implements FXPlatformRunnable{
private MoeEditor editor;
private int procTime;
public ReparseRunner(MoeEditor editor)
{
this.editor = editor;
this.procTime = 15;
}
public void run()
{
MoeSyntaxDocument document = editor.getSourceDocument();
long begin = System.currentTimeMillis();
if (PrefMgr.getScopeHighlightStrength().get() != 0 && document != null && document.pollReparseQueue()) {
while (System.currentTimeMillis() - begin < this.procTime){
if (! document.pollReparseQueue()) {
break;
}
}
editor.getSourceDocument().applyPendingScopeBackgrounds();
JavaFXUtil.runPlatformLater(this);
}
else {
editor.reparseRunnerFinished();
}
}
}
top,
use,
map,
class ReparseRunner
. ReparseRunner
. run
52 neLoCode
+ 5 LoComm