Listening to events from a swing element embedded in an SWT composite [message #449499] |
Tue, 25 January 2005 09:51  |
Eclipse User |
|
|
|
Hi
I am embedding a swing JEditorPane within an SWT Composite, which is nested
in a JFace dialog. I would like to listen to events that occur in the
JEditorPane, and according to them, to either enable/disable the OK button
of the dialog. I tried to access the JFace code from my swing listener, and
got an exception that says that the SWT code is running from the wrong
thread. Does anyone knows if swing opens its own thread, and if so, how can
i still access JFace/SWT elements from swing code.
thanks
Maya and Yoav
|
|
|
Re: Listening to events from a swing element embedded in an SWT composite [message #449521 is a reply to message #449499] |
Tue, 25 January 2005 11:29  |
Eclipse User |
|
|
|
Originally posted by: no.ddress.here
In article <ct5mhn$t0k$1@www.eclipse.org>, yoav@il.ibm.com says...
> Hi
> I am embedding a swing JEditorPane within an SWT Composite, which is nested
> in a JFace dialog. I would like to listen to events that occur in the
> JEditorPane, and according to them, to either enable/disable the OK button
> of the dialog. I tried to access the JFace code from my swing listener, and
> got an exception that says that the SWT code is running from the wrong
> thread. Does anyone knows if swing opens its own thread, and if so, how can
> i still access JFace/SWT elements from swing code.
> thanks
> Maya and Yoav
Look at:
Display.getDefault().asyncExec(
new Runnable() {
public void run() {
// SWT UI code here
}
});
Also, the .syncExec() method for in-line execution.
Regards,
Gerald
|
|
|
Powered by
FUDForum. Page generated in 0.03504 seconds