Java Code Examples for com.intellij.openapi.fileEditor.FileEditorManagerEvent#getNewFile()

The following examples show how to use com.intellij.openapi.fileEditor.FileEditorManagerEvent#getNewFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ORFileEditorListener.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
    VirtualFile newFile = event.getNewFile();
    if (newFile != null) {
        FileType fileType = newFile.getFileType();
        if (FileHelper.isReason(fileType) || FileHelper.isOCaml(fileType)) {
            // On tab change, we redo the background compilation
            Document document = FileDocumentManager.getInstance().getDocument(newFile);
            InsightUpdateQueue insightUpdateQueue = document == null ? null : document.getUserData(INSIGHT_QUEUE);
            if (insightUpdateQueue != null) {
                insightUpdateQueue.queue(m_project, document);
            }
            // and refresh inferred types
            InferredTypesService.queryForSelectedTextEditor(m_project);
        }
    }
}
 
Example 2
Source File: GitStatusWidget.java    From GitToolBox with Apache License 2.0 5 votes vote down vote up
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
  VirtualFile file = event.getNewFile();
  if (file != null) {
    runUpdate(myProject, file);
  } else {
    runUpdate(myProject);
  }
}
 
Example 3
Source File: BlameStatusWidget.java    From GitToolBox with Apache License 2.0 5 votes vote down vote up
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
  VirtualFile newFile = event.getNewFile();
  if (newFile != null) {
    log.debug("Selection changed: ", newFile);
    updateBlame(newFile);
  }
}