use of com.intellij.util.ui.update.MergingUpdateQueue in project oxy-template-support-plugin by mutant-industries.
the class CompiledPreviewController method initCompiledCodeUpdater.
// ----------------------------------------------------------------------------------------------------
private void initCompiledCodeUpdater() {
updateQueue = new MergingUpdateQueue("LIVE_PREVIEW_QUEUE", 1000, true, null, myProject);
EditorFactory.getInstance().getEventMulticaster().addDocumentListener(new DocumentListener() {
@Override
public void documentChanged(DocumentEvent e) {
Document document = e.getDocument();
VirtualFile file = FileDocumentManager.getInstance().getFile(document);
if (file == null || file.getFileType() != OxyTemplateFileType.INSTANCE) {
return;
}
updateQueue.cancelAllUpdates();
updateQueue.queue(new CompiledPreviewUpdater(Boolean.TRUE, myProject));
}
}, myProject);
}
Aggregations