|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
| Artur Kronenberg
Registered: August 2009
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.
[Updated on: Fri, 17 June 2011 13:01]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.08497 seconds