AWT events are not allowed inside write action On applyFix

已回答

When I show a dialog on localQuickFix, idea throw me a Throwable "AWT events are not allowed inside write action: java.awt.event.FocusEvent[FOCUS_LOST,temporary,opposite=EditorComponent..."

Something like I lost focus from main panel ?

Is there any method I can show a dialog when user click quickFix?

 

My "bug code" snippet shows as below:

@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
new DialogWrapper(true) {
@Override
protected @Nullable JComponent createCenterPanel() {
return null;
}
}.show();
}

 

And the error stack shows as below:

0

Override and return false from com.intellij.openapi.application.WriteActionAware#startInWriteAction

4

Wow. That's it! 

Thank you Yann.

0

请先登录再写评论。