Java 类com.intellij.openapi.fileTypes.FileTypeEvent 实例源码

项目:intellij-ce-playground    文件:PsiVFSListener.java   
public PsiVFSListener(Project project) {
  myProject = project;
  myFileTypeManager = FileTypeManager.getInstance();
  myProjectRootManager = ProjectRootManager.getInstance(project);
  myManager = (PsiManagerImpl) PsiManager.getInstance(project);
  myFileManager = (FileManagerImpl) myManager.getFileManager();

  myConnection = project.getMessageBus().connect(project);

  StartupManager.getInstance(project).registerPreStartupActivity(new Runnable() {
    @Override
    public void run() {
      myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyModuleRootListener());
      myConnection.subscribe(FileTypeManager.TOPIC, new FileTypeListener.Adapter() {
        @Override
        public void fileTypesChanged(@NotNull FileTypeEvent e) {
          myFileManager.processFileTypesChanged();
        }
      });
      myConnection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, new MyFileDocumentManagerAdapter());
      myFileManager.markInitialized();
    }
  });
}
项目:consulo    文件:BreadcrumbsInitializingActivity.java   
@Override
public void runActivity(@Nonnull UIAccess uiAccess, @Nonnull Project project) {
  if (project.isDefault() || ApplicationManager.getApplication().isUnitTestMode() || project.isDisposed()) {
    return;
  }

  MessageBusConnection connection = project.getMessageBus().connect();
  connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new MyFileEditorManagerListener());
  connection.subscribe(FileTypeManager.TOPIC, new FileTypeListener() {
    @Override
    public void fileTypesChanged(@Nonnull FileTypeEvent event) {
      reinitBreadcrumbsInAllEditors(project);
    }
  });

  VirtualFileManager.getInstance().addVirtualFileListener(new MyVirtualFileListener(project), project);
  connection.subscribe(UISettingsListener.TOPIC, uiSettings -> reinitBreadcrumbsInAllEditors(project));
}
项目:consulo    文件:PsiVFSListener.java   
public PsiVFSListener(Project project) {
  installGlobalListener();

  myProject = project;
  myFileTypeManager = FileTypeManager.getInstance();
  myProjectRootManager = ProjectRootManager.getInstance(project);
  myManager = (PsiManagerImpl)PsiManager.getInstance(project);
  myFileManager = (FileManagerImpl)myManager.getFileManager();

  StartupManager.getInstance(project).registerPreStartupActivity(() -> {
    MessageBusConnection connection = project.getMessageBus().connect(project);
    connection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyModuleRootListener());
    connection.subscribe(FileTypeManager.TOPIC, new FileTypeListener() {
      @Override
      public void fileTypesChanged(@Nonnull FileTypeEvent e) {
        myFileManager.processFileTypesChanged();
      }
    });
    connection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, new MyFileDocumentManagerAdapter());
  });
}
项目:intellij-ce-playground    文件:TextEditorComponent.java   
@Override
public void fileTypesChanged(@NotNull final FileTypeEvent event) {
  assertThread();
  // File can be invalid after file type changing. The editor should be removed
  // by the FileEditorManager if it's invalid.
  updateValidProperty();
  updateHighlighters();
}
项目:intellij-ce-playground    文件:FileEditorManagerImpl.java   
@Override
public void fileTypesChanged(@NotNull final FileTypeEvent event) {
  assertDispatchThread();
  final VirtualFile[] openFiles = getOpenFiles();
  for (int i = openFiles.length - 1; i >= 0; i--) {
    final VirtualFile file = openFiles[i];
    LOG.assertTrue(file != null);
    updateFileIcon(file);
  }
}
项目:tools-idea    文件:TextEditorComponent.java   
@Override
public void fileTypesChanged(final FileTypeEvent event) {
  assertThread();
  // File can be invalid after file type changing. The editor should be removed
  // by the FileEditorManager if it's invalid.
  updateValidProperty();
  updateHighlighters();
}
项目:tools-idea    文件:FileEditorManagerImpl.java   
@Override
public void fileTypesChanged(final FileTypeEvent event) {
  assertDispatchThread();
  final VirtualFile[] openFiles = getOpenFiles();
  for (int i = openFiles.length - 1; i >= 0; i--) {
    final VirtualFile file = openFiles[i];
    LOG.assertTrue(file != null);
    updateFileIcon(file);
  }
}
项目:tools-idea    文件:PsiVFSListener.java   
public PsiVFSListener(StartupManager startupManager,
                      FileTypeManager fileTypeManager,
                      PsiManager psiManager, 
                      ProjectRootManager projectRootManager) {
  myFileTypeManager = fileTypeManager;
  myProjectRootManager = projectRootManager;
  myProjectFileIndex = myProjectRootManager.getFileIndex();
  myManager = (PsiManagerImpl) psiManager;
  myFileManager = (FileManagerImpl) myManager.getFileManager();

  myConnection = psiManager.getProject().getMessageBus().connect(psiManager.getProject());

  startupManager.registerPreStartupActivity(new Runnable() {
    @Override
    public void run() {
      myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(PsiVFSListener.this));
      myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyModuleRootListener());
      myConnection.subscribe(FileTypeManager.TOPIC, new FileTypeListener.Adapter() {
        @Override
        public void fileTypesChanged(FileTypeEvent e) {
          myFileManager.processFileTypesChanged();
        }
      });
      myConnection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, new MyFileDocumentManagerAdapter());
      myFileManager.markInitialized();
    }
  });
}
项目:consulo    文件:TextEditorComponent.java   
@Override
public void fileTypesChanged(@Nonnull final FileTypeEvent event) {
  assertThread();
  // File can be invalid after file type changing. The editor should be removed
  // by the FileEditorManager if it's invalid.
  updateValidProperty();
  updateHighlighters();
}
项目:consulo    文件:FileEditorManagerImpl.java   
@Override
public void fileTypesChanged(@Nonnull final FileTypeEvent event) {
  assertDispatchThread();
  final VirtualFile[] openFiles = getOpenFiles();
  for (int i = openFiles.length - 1; i >= 0; i--) {
    final VirtualFile file = openFiles[i];
    LOG.assertTrue(file != null);
    updateFileIcon(file);
  }
}
项目:intellij-ce-playground    文件:BreadcrumbsLoaderComponent.java   
@Override
public void fileTypesChanged(@NotNull FileTypeEvent event) {
  reinitBreadcrumbsInAllEditors();
}