|
6 | 6 | import com.intellij.notification.Notification;
|
7 | 7 | import com.intellij.notification.NotificationType;
|
8 | 8 | import com.intellij.notification.Notifications;
|
| 9 | +import com.intellij.openapi.application.ApplicationManager; |
9 | 10 | import com.intellij.openapi.module.Module;
|
10 | 11 | import com.intellij.openapi.project.Project;
|
11 | 12 | import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
@@ -226,19 +227,21 @@ private void processOK() {
|
226 | 227 | Notifications.Bus.notify(notification);
|
227 | 228 | }
|
228 | 229 |
|
| 230 | + ApplicationManager.getApplication().invokeLater(() -> { |
| 231 | + try { |
| 232 | + onOK(); |
| 233 | + } catch (Exception e1) { |
| 234 | + e1.printStackTrace(); |
| 235 | + errorMessage = errorMessage != null ? errorMessage : "An error occurred adding reference - " + e1.getMessage(); |
| 236 | + } |
| 237 | + if (errorMessage != null) { |
| 238 | + errorTextPane.setVisible(true); |
| 239 | + errorTextPane.setText(errorMessage); |
| 240 | + } |
| 241 | + buttonOK.setEnabled(true); |
| 242 | + buttonCancel.setEnabled(true); |
| 243 | + }); |
229 | 244 |
|
230 |
| - try { |
231 |
| - onOK(); |
232 |
| - } catch (Exception e1) { |
233 |
| - e1.printStackTrace(); |
234 |
| - errorMessage = errorMessage != null ? errorMessage : "An error occurred adding reference - " + e1.getMessage(); |
235 |
| - } |
236 |
| - if (errorMessage != null) { |
237 |
| - errorTextPane.setVisible(true); |
238 |
| - errorTextPane.setText(errorMessage); |
239 |
| - } |
240 |
| - buttonOK.setEnabled(true); |
241 |
| - buttonCancel.setEnabled(true); |
242 | 245 | }
|
243 | 246 |
|
244 | 247 | private void setPackageBrowseText(String packageName) {
|
|
0 commit comments