use of com.intellij.openapi.module.impl.ModuleManagerImpl in project intellij-community by JetBrains.
the class ProjectImpl method distributeProgress.
private void distributeProgress() {
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator == null)
return;
ModuleManager moduleManager = ModuleManager.getInstance(this);
if (!(moduleManager instanceof ModuleManagerImpl)) {
return;
}
double toDistribute = 1 - indicator.getFraction();
int modulesCount = ((ModuleManagerImpl) moduleManager).getModulePathsCount();
EditorsSplitters splitters = ((FileEditorManagerImpl) FileEditorManager.getInstance(this)).getMainSplitters();
int editors = splitters.getEditorsCount();
double modulesPart = ourClassesAreLoaded || editors == 0 ? toDistribute : toDistribute * 0.5;
if (modulesCount != 0) {
double step = modulesPart / modulesCount;
((ModuleManagerImpl) moduleManager).setProgressStep(step);
}
if (editors != 0) {
splitters.setProgressStep(toDistribute - modulesPart / editors);
}
}
Aggregations