|How to get onto GUI Event Thread from non UI thread... [message #123060]
||Thu, 26 February 2009 05:30
Originally posted by: michael.suwiryo.siemens.com|
In RCP application especially in Java multi-threaded application, it's very
common to execute some code on a different thread (a.k.a Thread Hop) and
then go back to UI Thread to update the UI.
Getting back to SWT Display Thread in RCP is straightforward because RCP is
only for single user and this can be done using Display.getDefault() call
which always return the right Display.
As for RAP, due to the nature of multi-user environment, there is no easy
way to go back to UI Event Thread from non UI Thread.
One possible solution is to keep passing Display reference all over the
place. But in some scenario, passing Display reference is probably not
Second possible solution is to store the Display object as part of the
HTTPSession with unique ID and then retrieve it back as necessary. The
problem with 2nd solution is that the RWT Utility class requires to be run
in UI Thread. So, this also does not work in non UI Thread case.
The desired solution here is to have true implementation of
Display.getDefault() in RAP which return the right Display based on current
user session. I understand why it may not be easy to implement this in RAP.
However, if supported, it would be easier to convert an RCP application to
Besides the options I mention above, I was wondering if anyone has any
suggestion or pointer on how to solve this issue. Has anyone encountered
Thanks for any pointers.
Powered by FUDForum
. Page generated in 0.01929 seconds