Skip to main content



      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 03:29 Go to next message
Eclipse UserFriend
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

[Updated on: Thu, 02 June 2011 03:38] by 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 08:59 Go to previous message
Eclipse UserFriend
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 09:01] by Moderator

Previous Topic:FilteredSelectionDialog - Internal ContentProvider does not see model changes
Next Topic:Check Data Binding Values
Goto Forum:
  


Current Time: Wed Jul 23 19:15:03 EDT 2025

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

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

Back to the top