import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
+import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.Nls;
import org.zmlx.hg4idea.HgRevisionNumber;
import org.zmlx.hg4idea.HgVcsMessages;
private void loadBranches(VirtualFile root) {
new HgTagBranchCommand(project, root).listBranches(new Consumer<List<HgTagBranch>>() {
@Override
- public void consume(List<HgTagBranch> branches) {
- branchSelector.setModel(new DefaultComboBoxModel(branches.toArray()));
+ public void consume(final List<HgTagBranch> branches) {
+ UIUtil.invokeAndWaitIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ branchSelector.setModel(new DefaultComboBoxModel(branches.toArray()));
+ }
+ });
}
});
}
private void loadTags(VirtualFile root) {
new HgTagBranchCommand(project, root).listTags(new Consumer<List<HgTagBranch>>() {
@Override
- public void consume(List<HgTagBranch> tags) {
- tagSelector.setModel(new DefaultComboBoxModel(tags.toArray()));
+ public void consume(final List<HgTagBranch> tags) {
+ UIUtil.invokeAndWaitIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ tagSelector.setModel(new DefaultComboBoxModel(tags.toArray()));
+ }
+ });
}
});
}