mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-73474 - assert: DummyCachingFileSystem.onProjectOpened
This commit is contained in:
@@ -101,6 +101,9 @@ public class ProjectUtil {
|
||||
if (virtualFile == null) return null;
|
||||
virtualFile.refresh(false, false);
|
||||
|
||||
Project existing = findAndFocusExistingProjectForPath(path);
|
||||
if (existing != null) return existing;
|
||||
|
||||
ProjectOpenProcessor strong = ProjectOpenProcessor.getStrongImportProvider(virtualFile);
|
||||
if (strong != null) {
|
||||
return strong.doOpenProject(virtualFile, projectToClose, forceOpenInNewFrame);
|
||||
@@ -158,14 +161,10 @@ public class ProjectUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
for (Project project : openProjects) {
|
||||
if (!project.isDefault() && isSameProject(path, project)) {
|
||||
focusProjectWindow(project, false);
|
||||
return project;
|
||||
}
|
||||
}
|
||||
Project existing = findAndFocusExistingProjectForPath(path);
|
||||
if (existing != null) return existing;
|
||||
|
||||
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
if (!forceOpenInNewFrame && openProjects.length > 0) {
|
||||
int exitCode = confirmOpenNewProject(false);
|
||||
if (exitCode == GeneralSettings.OPEN_PROJECT_SAME_WINDOW) {
|
||||
@@ -199,6 +198,18 @@ public class ProjectUtil {
|
||||
return project;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Project findAndFocusExistingProjectForPath(String path) {
|
||||
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
for (Project project : openProjects) {
|
||||
if (!project.isDefault() && isSameProject(path, project)) {
|
||||
focusProjectWindow(project, false);
|
||||
return project;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link com.intellij.ide.GeneralSettings#OPEN_PROJECT_SAME_WINDOW}
|
||||
* {@link com.intellij.ide.GeneralSettings#OPEN_PROJECT_NEW_WINDOW}
|
||||
|
||||
Reference in New Issue
Block a user