|
From: Shlomy R. <sre...@gm...> - 2010-07-28 08:35:11
|
Hi, The class GUIUtilities in jEdit provides some UI dialogs for input, confirmation, etc. Most of the functions provide convenience wrappers to static functions in JOptionPane, which must be called from the EDT (Event Dispatch Thread) to eliminate threading issues. Currently some of these methods are called from worker threads - e.g. HypersearchRequest (which runs in a worker thread) calls "confirm" if the number of results exceeds some high number. There are two ways to fix it: 1. Add an explicit comment in GUIUtilities that all these static functions must be called from the EDT, and fix all callers that do not call from the EDT. 2. Change GUIUtilities to use SwingUtilities.invokeAndWait() or something of this sort to ensure that the GUI is created in the EDT. There's a need to define wrapper classes which can store the result of the GUI calls, to be returned when the dialog is dismissed, so the wrapper functions become somewhat "heavy". What do you think is the more appropriate solution? Thanks, Shlomy |