Closed eselmeister closed 4 years ago
Invalid thread access means that code is calling UI-Method from the wrong Thread (e.g. application or background thread) and not from UI-Thread. This is an error of the caller and would normally result in never getting a shell at all. Dsiplay.getCurrent().asyncExec/syncExec must be called to make ensure code is running on UI thread.
Display.getCurrent() == null could be used to check if on UI thread.
maybe a convenience method like executeInUIThread(Runnable)
would be useful? This could check if we are already on UI thread and if not, it could call Dsiplay.getCurrent().asyncExec/syncExec
When e.g. running the following chromatogram processors, an exception is thrown now:
It crashes when trying to get the Shell:
The following error is thrown:
The DisplayUtils class has been improved, which might need additional checks: