Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » threading problem with SWT_AWT
threading problem with SWT_AWT [message #516937] Thu, 25 February 2010 09:42
Eclipse UserFriend
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
Previous Topic:Adding a custom view to the RCP perspective
Next Topic:Birt Report
Goto Forum:
  


Current Time: Fri Jun 20 15:03:47 EDT 2025

Powered by FUDForum. Page generated in 0.04180 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top