JComponent activationComponent = WindowManager.getInstance().getFrame(project).getRootPane();
project.putUserData(LIVE_PREVIEW_QUEUE, queue = new MergingUpdateQueue("LIVE_PREVIEW_QUEUE", 1000, true, null, project, activationComponent));
}
final FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
final MergingUpdateQueue finalQueue = queue;
EditorFactory.getInstance().getEventMulticaster().addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
Document document = e.getDocument();
final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
VirtualFile file = fileDocumentManager.getFile(document);