Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Showing an Image while the section is being regenerated in the Background
Showing an Image while the section is being regenerated in the Background [message #675963] Thu, 02 June 2011 07:29 Go to next message
Animesh Kumar is currently offline Animesh Kumar
Messages: 79
Registered: September 2010
Location: Bangalore
Member
Hi,

I have an editor, which has two parts. The left part has a tree viewer and the right part has a section.
The right side section is regenerated based on the selection in the tree viewer and it takes around 20seconds to do this.
So, till the right side section is regenerated, I want to show an image, which says loading in the right part only. How can I do it most efficiently?
Can anyone help?
Thanks


Regards,
Animesh

[Updated on: Thu, 02 June 2011 07:38]

Report message to a moderator

Re: Showing an Image while the section is being regenerated in the Background [message #685401 is a reply to message #675963] Fri, 17 June 2011 12:59 Go to previous message
Artur Kronenberg is currently offline Artur Kronenberg
Messages: 159
Registered: August 2009
Senior Member
You can start your Job (Jobs API) and before you do that, you'll just put the loading image on the composite. You might wanna use a StackComposite, so you would have your main Composite with the information and a second one with the image. Also this way you don't have to make much changes in the UI. Maybe this is what you meant by "most efficiently" because you didn't want to recreate the user interface every time you are done showing the load image. This way you can switch easily between the two of them. Look for the StackComposite API for details.

You can then start your Job and have the work done in the background. You can also present progress by using the IProgressmonitor. By calling setUser( true ) you can have the progress pop up in the UI.
After your work is done, you can switch back the Composites. You can either hook a JobChangedListener on your job to notice when it is done, or you can do it in the job by calling Display#asyncExec() to modify the user interface.

kind regards,

--artur

[Updated on: Fri, 17 June 2011 13:01]

Report message to a moderator

Previous Topic:Check Data Binding Values
Next Topic:using 32 by 32 image in treeviewer
Goto Forum:
  


Current Time: Sat Oct 25 18:34:27 GMT 2014

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

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