Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Updating the status line
Updating the status line [message #444782] Mon, 20 February 2006 20:57 Go to next message
Eclipse UserFriend
Originally posted by: sjohnston.21technologies.com

Hey,

I'm having problems with the StatusLineManager class. I have a method
'updateStatusLine(String)' which gets the statusLineManager and calls
the setMessage method on it with the String passed. I call my
'updateStatusLine' method from a 'run' method of one of my user defined
actions classes. The problem is that the status line message doesn't
show until the 'run' method has completely finished. I've tried several
things like putting a 'Thread.sleep()' call after 'updateStatusLine',
but it doesn't seem to work. What I would like to do is have the user
click an action and 'updateStatusLine("Please wait for operation to
complete...")' then do the rest of the 'run' method and
'updateStatusLine("Ontology Loaded.")'

Thanks,
-Stephen
Re: Updating the status line [message #444790 is a reply to message #444782] Tue, 21 February 2006 03:40 Go to previous messageGo to next message
Rohit Khariwal is currently offline Rohit KhariwalFriend
Messages: 114
Registered: July 2009
Senior Member
hi stephen,
have you written statuslinemanager.update(true); after the setMessage line.
Re: Updating the status line [message #444908 is a reply to message #444790] Thu, 23 February 2006 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sjohnston.21technologies.com

Thanks for the reply Rohit,

Yes, I have tried this. It works in most cases. My situation is that
I have an Action which does a couple things.

1. updateStatusLine("Ontology loading. Please Wait...")
2. update the ontology tree
3. updateStatusLine("Loading " + openFile.getName() + " complete")

The status line will not refresh until after the tree view has been
loaded and displayed.

Rohit Khariwal wrote:
> hi stephen,
> have you written statuslinemanager.update(true); after the setMessage line.
Re: Updating the status line [message #444910 is a reply to message #444782] Thu, 23 February 2006 20:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paulnews.gmail.com

It won't be updated until the SWT event loop gets a chance to process
stuff and re-paint widgets (which won't happen until after your run()
method).

If you're really attached to the status line, you can put your code in a
Job and use display.syncExec(*) to call back into the UI thread to set
the status line ... I'm not 100% sure, but I think it'll allow the event
thread to spin.

A more common way of providing this kind of feedback to a user is to
have your action spawn a Job and use the progress monitor to give the
feedback ... the event loop spins, the UI updates, and the user can
leave it in a pop up, or see it in the progress view, etc.

Later,
PW
Re: Updating the status line [message #444936 is a reply to message #444910] Fri, 24 February 2006 17:17 Go to previous message
Eclipse UserFriend
Originally posted by: sjohnston.21technologies.com

Paul,

Thanks for the reply. I have not used the progress monitor before, but
it sounds more like the mechanism that I want. I will dig around for
some examples on how to use it correctly.


Paul News wrote:
> It won't be updated until the SWT event loop gets a chance to process
> stuff and re-paint widgets (which won't happen until after your run()
> method).
>
> If you're really attached to the status line, you can put your code in a
> Job and use display.syncExec(*) to call back into the UI thread to set
> the status line ... I'm not 100% sure, but I think it'll allow the event
> thread to spin.
>
> A more common way of providing this kind of feedback to a user is to
> have your action spawn a Job and use the progress monitor to give the
> feedback ... the event loop spins, the UI updates, and the user can
> leave it in a pop up, or see it in the progress view, etc.
>
> Later,
> PW
Previous Topic:ViewPart.saveState(..) not called
Next Topic:List with images
Goto Forum:
  


Current Time: Fri Nov 15 00:36:02 GMT 2024

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

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

Back to the top