Annoying compaction progress on splash

This commit is contained in:
Konstantin Bulenkov
2013-06-03 14:30:44 +02:00
parent 8a2f37c229
commit c836710da3
4 changed files with 14 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,6 +143,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
.getInstance().runProcessWithProgressSynchronously(new ThrowableComputable<MapIndexStorage<K, StubIdList>, IOException>() {
@Override
public MapIndexStorage<K, StubIdList> compute() throws IOException {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
return new MapIndexStorage<K, StubIdList>(
IndexInfrastructure.getStorageFile(indexKey),
extension.getKeyDescriptor(),
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -409,6 +409,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
.getInstance().runProcessWithProgressSynchronously(new ThrowableComputable<MapIndexStorage<K, V>, IOException>() {
@Override
public MapIndexStorage<K, V> compute() throws IOException {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
return new MapIndexStorage<K, V>(
IndexInfrastructure.getStorageFile(name),
extension.getKeyDescriptor(),
@@ -523,6 +524,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
new ThrowableComputable<PersistentHashMap<Integer, Collection<K>>, IOException>() {
@Override
public PersistentHashMap<Integer, Collection<K>> compute() throws IOException {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
return createIdToDataKeysIndex(indexId, keyDescriptor, storage);
}
};
@@ -23,6 +23,7 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.application.impl.LaterInvocator;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.command.CommandProcessorEx;
@@ -760,6 +761,11 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
setBackground(UIUtil.getPanelBackground());
if (!ApplicationManagerEx.getApplicationEx().isLoaded()) {
final Point loc = getLocation();
loc.y += Splash.SIZE.getHeight() / 2 + 42; // half splash + progress header
setLocation(loc);
}
super.show();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ import java.util.List;
* @author Konstantin Bulenkov
*/
public class Splash extends JDialog implements StartupProgress {
public static Dimension SIZE;
private final Icon myImage;
private int myProgressHeight = 2;
private Color myProgressColor = null;
@@ -61,6 +62,7 @@ public class Splash extends JDialog implements StartupProgress {
setFocusableWindowState(false);
Icon originalImage = IconLoader.getIcon(imageName);
SIZE = new Dimension(originalImage.getIconWidth(), originalImage.getIconHeight());
myImage = new SplashImage(originalImage, textColor);
myLabel = new JLabel(myImage) {
@Override