fix "IDEA-221944 Deadlock on opening second project" and support preloading for proje...
[idea/community.git] / platform / vcs-impl / src / com / intellij / openapi / vcs / configurable / VcsManagerConfigurableProvider.java
1 // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.openapi.vcs.configurable;
3
4 import com.intellij.openapi.options.Configurable;
5 import com.intellij.openapi.options.ConfigurableProvider;
6 import com.intellij.openapi.project.Project;
7 import com.intellij.openapi.vcs.ProjectLevelVcsManager;
8 import org.jetbrains.annotations.NotNull;
9
10 public final class VcsManagerConfigurableProvider extends ConfigurableProvider {
11   @NotNull private final Project myProject;
12
13   public VcsManagerConfigurableProvider(@NotNull Project project) {
14     myProject = project;
15   }
16
17   @NotNull
18   @Override
19   public Configurable createConfigurable() {
20     return new VcsManagerConfigurable(myProject);
21   }
22
23   @Override
24   public boolean canCreateConfigurable() {
25     return !myProject.isDefault() && ProjectLevelVcsManager.getInstance(myProject).getAllVcss().length > 0;
26   }
27 }