Disabling IAction from non-UI thread. [message #1242995] |
Mon, 10 February 2014 06:13  |
Eclipse User |
|
|
|
Hi all,
Some part of my code that updates UI runs in ExecutorService, i.e:
...
ExecutorService executor = new ThreadPoolExecutor(1, 1, 1000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1000));
Runnable task = new Runnable()
{
@Override
public void run()
{
IAction action = ...
action.setEnable(false);
}
}
executor.execute(task);
...
The code above throws IllegalStateException since it's not running in UI thread but to do so I have to obtain instance of Display using Display.getCurrent() or Display.getDefault() which keeps returning null.
Any ideas ?
Any help would be greatly appreciated.
Thanks & Regards,
Setya
|
|
|
|
Powered by
FUDForum. Page generated in 0.05891 seconds