IDEA-144699 "Annotate" action from action popup does not redraw toggle when processed

This commit is contained in:
Sergey Ignatov
2015-09-04 14:06:35 +03:00
parent a02a57157f
commit e7973c46ba
2 changed files with 25 additions and 0 deletions
@@ -23,16 +23,19 @@ import com.intellij.ide.ui.search.OptionDescription;
import com.intellij.ide.util.gotoByName.ChooseByNamePopup;
import com.intellij.ide.util.gotoByName.GotoActionItemProvider;
import com.intellij.ide.util.gotoByName.GotoActionModel;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.progress.util.ProgressWindow;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
@@ -125,6 +128,20 @@ public class GotoActionAction extends GotoActionBase implements DumbAware {
}
};
ApplicationManager.getApplication().getMessageBus().connect().subscribe(ProgressWindow.TOPIC, new ProgressWindow.Listener() {
@Override
public void created(ProgressWindow pw) {
Disposer.register(pw, new Disposable() {
@Override
public void dispose() {
if (!popup.checkDisposed()) {
popup.repaintList();
}
}
});
}
});
if (project != null) {
project.putUserData(ChooseByNamePopup.CHOOSE_BY_NAME_POPUP_IN_PROJECT_KEY, popup);
}
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.ui.FocusTrackback;
import com.intellij.util.messages.Topic;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -65,6 +66,12 @@ public class ProgressWindow extends ProgressIndicatorBase implements BlockingPro
@Nullable private volatile Runnable myBackgroundHandler;
private int myDelayInMillis = DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS;
public interface Listener {
void created(ProgressWindow pw);
}
public static final Topic<Listener> TOPIC = Topic.create("progress window", Listener.class);
public ProgressWindow(boolean shouldShowCancel, Project project) {
this(shouldShowCancel, false, project);
}
@@ -112,6 +119,7 @@ public class ProgressWindow extends ProgressIndicatorBase implements BlockingPro
}
}
});
ApplicationManager.getApplication().getMessageBus().syncPublisher(TOPIC).created(this);
}
@Override