Assertion failed: cannot share data context between Swing events

Occurs in AnAction.actionPerformed() called by shortcut.

Action looks like:


Workaround: swap lines :)
Any comments?

1 comment
Comment actions Permalink

Hello Alexei,

Showing a dialog actually invalidates the data context which is passed to
your actionPerformed method, because the UI state may have changed.

Occurs in AnAction.actionPerformed() called by shortcut.

Action looks like:

 int scope = Messages.showChooseDialog("Choose scope", "Choose
> scope",
> new String[]{OPT_CLASS, OPT_PACKAGE }, OPT_CLASS,
> null);
> Project project = DataKeys.PROJECT.getData(e.getDataContext()); //
> failed there
> ]]>

Workaround: swap lines :)
Any comments?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.