This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
Swing + SWT, change mouse cursor to WAIT (newbie question)
posted 4 years ago
I am a new to Eclipse RCP and I am having a trouble with getting a few things done correctly. The thing that I want to do is to change mouse cursor in whole application.
I have 2 views in my app, one is a setting pane and the other one presents results. Both of them incorporate Swing containers, because I had to use old pieces of code, special graphs etc.
Loading the result pane takes time, usually a few seconds. Meanwhile I want the cursor to be changed. So, when I press the correct button, I try to do something like that:
Register.getMapaView().loadMap() is the part, that takes so much time. Now my enableWaitCursor() looks like that:
I found somewhere on the web, that it is the way I should go. But... It looks strange. It's an infinite loop. How do I reverse the change of the cursor? Is it really OK the way I did it? Plus, when I move the cursor, it flickers as it turns to the arrow back when it is on the move and gets back to the "busy" when stops. And at last, when I exit the application, I get an error:
"!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.ui.internal.progress.TaskBarProgressManager$2". I suppose it's the thread I run to change the mouse cursor.