Search in sources :

Example 1 with ExternalSystemProjectsWatcher

use of com.intellij.openapi.externalSystem.service.project.autoimport.ExternalSystemProjectsWatcher in project intellij-community by JetBrains.

the class ExternalProjectsManager method init.

public void init() {
    synchronized (isInitialized) {
        if (isInitialized.getAndSet(true))
            return;
        myWatcher = new ExternalSystemProjectsWatcher(myProject);
        myWatcher.start();
        // load external projects data
        ExternalProjectsDataStorage.getInstance(myProject).load();
        myRunManagerListener.attach();
        // init shortcuts manager
        myShortcutsManager.init();
        for (ExternalSystemManager<?, ?, ?, ?, ?> systemManager : ExternalSystemApiUtil.getAllManagers()) {
            final Collection<ExternalProjectInfo> externalProjects = ExternalProjectsDataStorage.getInstance(myProject).list(systemManager.getSystemId());
            for (ExternalProjectInfo externalProject : externalProjects) {
                if (externalProject.getExternalProjectStructure() == null)
                    continue;
                Collection<DataNode<TaskData>> taskData = ExternalSystemApiUtil.findAllRecursively(externalProject.getExternalProjectStructure(), TASK);
                myShortcutsManager.scheduleKeymapUpdate(taskData);
            }
            if (!externalProjects.isEmpty()) {
                myShortcutsManager.scheduleRunConfigurationKeymapUpdate(systemManager.getSystemId());
            }
        }
        // init task activation info
        myTaskActivator.init();
    }
}
Also used : ExternalProjectInfo(com.intellij.openapi.externalSystem.model.ExternalProjectInfo) ExternalSystemProjectsWatcher(com.intellij.openapi.externalSystem.service.project.autoimport.ExternalSystemProjectsWatcher) DataNode(com.intellij.openapi.externalSystem.model.DataNode)

Aggregations

DataNode (com.intellij.openapi.externalSystem.model.DataNode)1 ExternalProjectInfo (com.intellij.openapi.externalSystem.model.ExternalProjectInfo)1 ExternalSystemProjectsWatcher (com.intellij.openapi.externalSystem.service.project.autoimport.ExternalSystemProjectsWatcher)1