Hello
I'm having some threading issues with SWT_AWT. I have a SharedHeaderFormEditor and in one of the pages I integrate jgraph (jgraph.com Swing graphic tooling).
Since the initialization takes a while I want to notify the user that work is beeing done using
getEditor().getHeaderForm().getForm().setBusy(true);
doing this on plain SWT pages, everything works fine. Using SWT_AWT somehow blocks my whole RCP application and now "loading" is displayed.
does anybody have a hint on how to conquer this threading issue?
here the code from createFormContent(IManagedForm managedForm)
getEditor().getHeaderForm().getForm().setBusy(true);
Composite parent = managedForm.getForm().getForm().getBody();
parent.setLayout(new FillLayout());
Composite embeddedComposite = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
embeddedComposite.setLayout(new FillLayout());
final Frame frame = SWT_AWT.new_Frame(embeddedComposite);
graphicEditor = createEditor();
frame.add(graphicEditor);
graphicEditor.addPropertyChangeListener(propertyChangeListener);
// according to http://www.eclipsezone.com/eclipse/forums/t45697.html
Listener listener = new Listener() {
public void handleEvent(Event e) {
if (SWT.Dispose == e.type) {
EventQueue.invokeLater(new Runnable() {
public void run() {
frame.dispose();
}
});
}
}
};
embeddedComposite.addListener(SWT.Dispose, listener);
getEditor().getHeaderForm().getForm().setBusy(false);
would really appreciate any help/hint/tip.
flavio