API Support wrote:
Chart should be opened from plugin thread by calling IPluginContext.executeTask(task);
'OnClick' handler is executed
NOT in plugin thread, it is executed in the AWT Event Dispatcher thread - and the problem is caused by the 'SwingUtilities.invokeAndWait()' in 'openChart()'.
Correct implementation of 'openChart()' method would be checking if we are already in Event Dispatcher thread using method 'EventQueue.isDispatchThread()' and, if yes, executing same code without wrapping into 'SwingUtilities.invokeAndWait()'
The recommendation you provide is actually
a workaround, which i'm already using - calling openChart() from any non-Event-Dispatcher thread does work, but this way is not natural.