Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » threading problem with SWT_AWT
threading problem with SWT_AWT [message #516937] Thu, 25 February 2010 14:42
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 161
Registered: July 2009
Location: Switzerland
Senior Member
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


Organisations- und Prozessdokumentation Software
Qualit├Ąt Management QMS :: Information Management IMS
http://www.scodi.ch
Previous Topic:Adding a custom view to the RCP perspective
Next Topic:Birt Report
Goto Forum:
  


Current Time: Sat Nov 29 03:46:55 GMT 2014

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

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