Java 类com.intellij.util.messages.impl.MessageListenerList 实例源码

项目:tools-idea    文件:FileEditorManagerImpl.java   
public FileEditorManagerImpl(final Project project, DockManager dockManager) {
/*    ApplicationManager.getApplication().assertIsDispatchThread(); */
    myProject = project;
    myDockManager = dockManager;
    myListenerList =
      new MessageListenerList<FileEditorManagerListener>(myProject.getMessageBus(), FileEditorManagerListener.FILE_EDITOR_MANAGER);

    if (Extensions.getExtensions(FileEditorAssociateFinder.EP_NAME).length > 0) {
      myListenerList.add(new FileEditorManagerAdapter() {
        @Override
        public void selectionChanged(@NotNull FileEditorManagerEvent event) {
          EditorsSplitters splitters = getSplitters();
          openAssociatedFile(event.getNewFile(), splitters.getCurrentWindow(), splitters);
        }
      });
    }

    myQueue.setTrackUiActivity(true);
  }
项目:intellij-ce-playground    文件:FileEditorManagerImpl.java   
public FileEditorManagerImpl(final Project project, DockManager dockManager, EditorHistoryManager editorHistoryManager) {
/*    ApplicationManager.getApplication().assertIsDispatchThread(); */
    myProject = project;
    myDockManager = dockManager;
    myEditorHistoryManager = editorHistoryManager;
    myListenerList =
      new MessageListenerList<FileEditorManagerListener>(myProject.getMessageBus(), FileEditorManagerListener.FILE_EDITOR_MANAGER);

    if (Extensions.getExtensions(FileEditorAssociateFinder.EP_NAME).length > 0) {
      myListenerList.add(new FileEditorManagerAdapter() {
        @Override
        public void selectionChanged(@NotNull FileEditorManagerEvent event) {
          EditorsSplitters splitters = getSplitters();
          openAssociatedFile(event.getNewFile(), splitters.getCurrentWindow(), splitters);
        }
      });
    }

    myQueue.setTrackUiActivity(true);

    project.getMessageBus().connect().subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() {

      public void enteredDumbMode() {
      }

      public void exitDumbMode() {
        // can happen under write action, so postpone to avoid deadlock on FileEditorProviderManager.getProviders()
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            if (!project.isDisposed())
              dumbModeFinished(project);
          }
        });
      }
    });
  }
项目:tools-idea    文件:ProjectJdkTableImpl.java   
public ProjectJdkTableImpl() {
  myMessageBus = ApplicationManager.getApplication().getMessageBus();
  myListenerList = new MessageListenerList<Listener>(myMessageBus, JDK_TABLE_TOPIC);
  // support external changes to jdk libraries (Endorsed Standards Override)
  VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
    @Override
    public void fileCreated(VirtualFileEvent event) {
      updateJdks(event.getFile());
    }

    private void updateJdks(VirtualFile file) {
      if (file.isDirectory() || !FileTypes.ARCHIVE.equals(file.getFileType())) {
        // consider only archive files that may contain libraries
        return;
      }
      for (Sdk sdk : mySdks) {
        final SdkType sdkType = (SdkType)sdk.getSdkType();
        if (!(sdkType instanceof JavaSdkType)) {
          continue;
        }
        final VirtualFile home = sdk.getHomeDirectory();
        if (home == null) {
          continue;
        }
        if (VfsUtilCore.isAncestor(home, file, true)) {
          sdkType.setupSdkPaths(sdk);
          // no need to iterate further assuming the file cannot be under the home of several SDKs
          break;
        }
      }
    }
  });
}