tags:

views:

47

answers:

1

Hi, I need to change status line message from a handler class. After reading the RCP tutorial and eclipse FAQ, I finally did something like this:

HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().findView(AView.ID).getViewSite().getActionBars().getStatusLineManager().setMessage( "Ha, I'm finished");

What a long invoking chain!

Am I doing it the right way? Thanks.

+1  A: 

From the threads I see in the forums, that looks about right.

Beware though if you have asynchronous feedback to put in this status line.
See this thread for instance.

UIJob job = new UIJob() {
    public IStatus run(IProgressMonitor monitor) {
    //do the long running work here

    Runnable results = new Runnable() {
        public void run(){
              // update UI elements here;
             getViewSite().getActionBars().getStatusLineManager().
               setMessage("End Pasting");
       }
    };
    display.asyncExec(results);
    }
};
job.schedule();

(Note: that may be not your case, but I add this code snippet just for information)

VonC

related questions