Skip to content

Commit ac3e05c

Browse files
committed
Add back invokeLater but via ApplicationManager.
1 parent 7af4f22 commit ac3e05c

File tree

1 file changed

+15
-12
lines changed
  • src/ServiceStackIDEA/src/main/java/net/servicestack/idea

1 file changed

+15
-12
lines changed

src/ServiceStackIDEA/src/main/java/net/servicestack/idea/AddRef.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.intellij.notification.Notification;
77
import com.intellij.notification.NotificationType;
88
import com.intellij.notification.Notifications;
9+
import com.intellij.openapi.application.ApplicationManager;
910
import com.intellij.openapi.module.Module;
1011
import com.intellij.openapi.project.Project;
1112
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
@@ -226,19 +227,21 @@ private void processOK() {
226227
Notifications.Bus.notify(notification);
227228
}
228229

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+
});
229244

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);
242245
}
243246

244247
private void setPackageBrowseText(String packageName) {

0 commit comments

Comments
 (0)