@Override
  public void contentsChanged(VirtualFileEvent event) {
    if (event.isFromSave()) return;
    final VirtualFile file = event.getFile();
    final Document document = getCachedDocument(file);
    if (document == null) {
      myMultiCaster.fileWithNoDocumentChanged(file);
      return;
    }

    if (isBinaryWithDecompiler(file)) {
      myMultiCaster.fileWithNoDocumentChanged(
          file); // This will generate PSI event at FileManagerImpl
    }

    long documentStamp = document.getModificationStamp();
    long oldFileStamp = event.getOldModificationStamp();
    if (documentStamp != oldFileStamp) {
      LOG.info("reload from disk?");
      LOG.info("  documentStamp:" + documentStamp);
      LOG.info("  oldFileStamp:" + oldFileStamp);

      if (file.isValid() && askReloadFromDisk(file, document)) {
        reloadFromDisk(document);
      }
    } else {
      reloadFromDisk(document);
    }
  }
 @Override
 public void fileDeleted(VirtualFileEvent event) {
   Document doc = getCachedDocument(event.getFile());
   if (doc != null) {
     myTrailingSpacesStripper.documentDeleted(doc);
   }
 }
 private void processEvent(VirtualFileEvent event) {
   if (event.isFromRefresh() && ANNOTATIONS_XML.equals(event.getFileName())) {
     dropCache();
     notifyChangedExternally();
   }
 }