Search in sources :

Example 6 with FileStatusManager

use of com.intellij.openapi.vcs.FileStatusManager in project intellij-community by JetBrains.

the class FileEditorManagerImpl method projectOpened.

protected void projectOpened(@NotNull MessageBusConnection connection) {
    //myFocusWatcher.install(myWindows.getComponent ());
    getMainSplitters().startListeningFocus();
    final FileStatusManager fileStatusManager = FileStatusManager.getInstance(myProject);
    if (fileStatusManager != null) {
        /*
        Updates tabs colors
       */
        final MyFileStatusListener myFileStatusListener = new MyFileStatusListener();
        fileStatusManager.addFileStatusListener(myFileStatusListener, myProject);
    }
    connection.subscribe(FileTypeManager.TOPIC, new MyFileTypeListener());
    connection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyRootsListener());
    /*
      Updates tabs names
     */
    final MyVirtualFileListener myVirtualFileListener = new MyVirtualFileListener();
    VirtualFileManager.getInstance().addVirtualFileListener(myVirtualFileListener, myProject);
    /*
      Extends/cuts number of opened tabs. Also updates location of tabs.
     */
    connection.subscribe(UISettingsListener.TOPIC, new MyUISettingsListener());
    StartupManager.getInstance(myProject).registerPostStartupActivity((DumbAwareRunnable) () -> {
        if (myProject.isDisposed())
            return;
        setTabsMode(UISettings.getInstance().getEditorTabPlacement() != UISettings.TABS_NONE);
        ToolWindowManager.getInstance(myProject).invokeLater(() -> {
            if (!myProject.isDisposed()) {
                CommandProcessor.getInstance().executeCommand(myProject, () -> {
                    ApplicationManager.getApplication().invokeLater(() -> {
                        long currentTime = System.nanoTime();
                        Long startTime = myProject.getUserData(ProjectImpl.CREATION_TIME);
                        if (startTime != null) {
                            LOG.info("Project opening took " + (currentTime - startTime.longValue()) / 1000000 + " ms");
                            PluginManagerCore.dumpPluginClassStatistics();
                        }
                    }, myProject.getDisposed());
                }, "", null);
            }
        });
    });
}
Also used : FileStatusManager(com.intellij.openapi.vcs.FileStatusManager)

Aggregations

FileStatusManager (com.intellij.openapi.vcs.FileStatusManager)6 FileStatus (com.intellij.openapi.vcs.FileStatus)3 FileEditorManagerEx (com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)1 EditorComposite (com.intellij.openapi.fileEditor.impl.EditorComposite)1 EditorWindow (com.intellij.openapi.fileEditor.impl.EditorWindow)1 Project (com.intellij.openapi.project.Project)1 Pair (com.intellij.openapi.util.Pair)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 LightVirtualFile (com.intellij.testFramework.LightVirtualFile)1 SimpleTextAttributes (com.intellij.ui.SimpleTextAttributes)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1