HgPullDialog access to UI components should be from AWT
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Sun, 24 Apr 2011 11:38:33 +0000 (15:38 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Sun, 24 Apr 2011 12:13:04 +0000 (16:13 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgPullDialog.java

index 2e70e4ab26b9a4341a4825950aec0d4298dc7235..092efb15b5b9f8eab01b0996c474e97c7eacc0fa 100644 (file)
@@ -16,6 +16,7 @@ import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.ui.UIUtil;
 import org.apache.commons.lang.StringUtils;
 import org.zmlx.hg4idea.command.HgShowConfigCommand;
 
@@ -88,8 +89,14 @@ public class HgPullDialog extends DialogWrapper {
       public void run() {
         VirtualFile repo = hgRepositorySelector.getRepository();
         HgShowConfigCommand configCommand = new HgShowConfigCommand(project);
-        String defaultPath = configCommand.getDefaultPath(repo);
-        sourceTxt.setText(defaultPath);
+        final String defaultPath = configCommand.getDefaultPath(repo);
+        UIUtil.invokeAndWaitIfNeeded(new Runnable() {
+          @Override
+          public void run() {
+            sourceTxt.setText(defaultPath);
+          }
+        });
+
         onChangePullSource();
       }
     });