Page 1 of 1

Show the framework action progress

Posted: Tue Jun 04, 2013 10:44 pm
by sebastienlavandier
Hello,

I have an Oxygen customized framework, which contain a custom action.

This action can often take long time (with a specific thread).
That why I want indicate to the user, that the action is in progress.

How I can disable the toolbar button, unfortunatly I'm in the Oxygen framework's module and so I can't access to the toolbar.

else how I can access to the status bar, for indicate the action's progress to user ...

Could you give an idea for help me.
Thanks in advance for your help.

Sébastien

Re: Show the framework action progress

Posted: Wed Jun 05, 2013 9:04 am
by Radu
Hi Sébastien,

To change the status in Oxygen you have this API:

Code: Select all

authorAccess.getWorkspaceAccess().showStatusMessage(statusMessage);
Basically your operation could also do something like this:

1) Start a thread which fetches stuff from the server.
2) Change the status, maybe also show a modal JDialog (with a Cancel button?) which will block user interraction while the operation is in progress.
3) At the end of the thread's run() method change the status to something else and hide the modal dialog.

It's important that all modifications made to the Author nodes should be done on the AWT thread (and not on your started thread). So if you make modifications directly on your thread, just invoke them on AWT like

Code: Select all

SwingUtilities.invokeAndWait
.

Regards,
Radu