mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
init UI as fast as possible
This commit is contained in:
+34
-24
@@ -47,6 +47,7 @@ import com.intellij.ui.navigation.BackAction;
|
||||
import com.intellij.ui.navigation.ForwardAction;
|
||||
import com.intellij.ui.navigation.History;
|
||||
import com.intellij.ui.navigation.Place;
|
||||
import com.intellij.util.io.storage.HeavyProcessLatch;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -280,35 +281,44 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
myWasUiDisposed = false;
|
||||
// need this to ensure VFS operations will not block because of storage flushing
|
||||
// and other maintenance IO tasks run in background
|
||||
HeavyProcessLatch.INSTANCE.processStarted();
|
||||
|
||||
myContext.reset();
|
||||
|
||||
myProjectJdksModel.reset(myProject);
|
||||
try {
|
||||
myWasUiDisposed = false;
|
||||
|
||||
Configurable toSelect = null;
|
||||
for (Configurable each : myName2Config) {
|
||||
if (myUiState.lastEditedConfigurable != null && myUiState.lastEditedConfigurable.equals(each.getDisplayName())) {
|
||||
toSelect = each;
|
||||
myContext.reset();
|
||||
|
||||
myProjectJdksModel.reset(myProject);
|
||||
|
||||
Configurable toSelect = null;
|
||||
for (Configurable each : myName2Config) {
|
||||
if (myUiState.lastEditedConfigurable != null && myUiState.lastEditedConfigurable.equals(each.getDisplayName())) {
|
||||
toSelect = each;
|
||||
}
|
||||
if (each instanceof MasterDetailsComponent) {
|
||||
((MasterDetailsComponent)each).setHistory(myHistory);
|
||||
}
|
||||
each.reset();
|
||||
}
|
||||
if (each instanceof MasterDetailsComponent) {
|
||||
((MasterDetailsComponent)each).setHistory(myHistory);
|
||||
|
||||
myHistory.clear();
|
||||
|
||||
if (toSelect == null && myName2Config.size() > 0) {
|
||||
toSelect = myName2Config.iterator().next();
|
||||
}
|
||||
|
||||
removeSelected();
|
||||
|
||||
navigateTo(toSelect != null ? createPlaceFor(toSelect) : null, false);
|
||||
|
||||
if (myUiState.proportion > 0) {
|
||||
mySplitter.setProportion(myUiState.proportion);
|
||||
}
|
||||
each.reset();
|
||||
}
|
||||
|
||||
myHistory.clear();
|
||||
|
||||
if (toSelect == null && myName2Config.size() > 0) {
|
||||
toSelect = myName2Config.iterator().next();
|
||||
}
|
||||
|
||||
removeSelected();
|
||||
|
||||
navigateTo(toSelect != null ? createPlaceFor(toSelect) : null, false);
|
||||
|
||||
if (myUiState.proportion > 0) {
|
||||
mySplitter.setProportion(myUiState.proportion);
|
||||
finally {
|
||||
HeavyProcessLatch.INSTANCE.processFinished();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user