I am doing a project using GEF. I need to open a popup window when double click the model in the canvas.
I create a SWT window and let GEF to open it. But the problem is it casue an exception:
Exception in thread "Thread-5" org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Invalid thread access)
when running following code.
while(!shell.isDisposed()){
**if(!display.readAndDispatch()){**
display.sleep();
}
}
What i did in my project is create the SWT window, then make a thread to run it, and call the thread in my model's editpart like this:
public void performRequest(Request req)
{
swtthread aa = new swtthread();
aa.start();
}
Do possible a GEF can use SWT window as a popup window or is there any other way to do this?
Thank you