Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » status line message not always visible
status line message not always visible [message #512020] Wed, 03 February 2010 16:45 Go to next message
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Hi,
I'm still fighting against the status line. In my application I've defined a wrapper as follows:

public class StatusBar implements ProgressMonitor {

    
    /**
     * The status line manager of the eclipse application.
     */
    private IStatusLineManager statusLineManager = null;
    
    /**
     * The progress monitor of the rcp application.
     */
    private IProgressMonitor progressMonitor = null;
    
    /**
     * The instance of myself.
     */
    private static StatusBar mySelf = null;
    
    
    private StatusBar(){
	super();
    }
    
    
    public static synchronized StatusBar getInstance(){
	if( mySelf == null )
	    mySelf = new StatusBar();
	
	return mySelf;
    }
    
    public void beginTask(String taskName, int maxUnitOfWork) {
	this.statusLineManager.setMessage(taskName);
	this.progressMonitor = this.statusLineManager.getProgressMonitor();
	this.progressMonitor.beginTask(taskName, maxUnitOfWork);
    }

    public void done() {
	this.progressMonitor.done();
    }

    public void incrementUnitOfWork() {
	//this.progressMonitor.worked(1);
    }

    public void setErrorMessage(String errorMessage) {
	this.statusLineManager.setErrorMessage(errorMessage);
    }

    public void setMessage(String message) {
	this.statusLineManager.setMessage(message);
    }

   ...
}


This is a singleton object that wraps the StatusLineManager in order to be used in non-ui packages (thru an interface).
Now this works, sometimes!

For instance, if in the postWindowOpen I call the setMessage I can see the message on the status line:

 public void postWindowOpen() {
	...
	StatusBar statusBar = StatusBar.getInstance();
	statusBar.setStatusLineManager( configurer.getActionBarConfigurer().getStatusLineManager() );
	statusBar.setMessage("Ready");
    }


If I call it from a perspective as follows, it works too:

public void createInitialLayout(IPageLayout layout) {
	...
	StatusBar.getInstance().setMessage("Dati sul personale");
    }


So the StatusBar is working, but if I call it from within a DAO or a view in the same way as above, it does not work! I cannot see any message on the status line, even if I'm sure that the setMessage method is called (I've debugged). I've also checked that the thread running is the UI thread, so it should make the message visible. What it could be that allows me to show the status message only within some contexts? Please note that I've got only a few places from within the setMessage is called, I don't think it is a problem of some components that overwrites the status line.
I'm quite attonished, anything I can investigate or do?

Thanks
Re: status line message not always visible [message #512242 is a reply to message #512020] Thu, 04 February 2010 13:41 Go to previous message
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Maybe I got it: the problem is that I'm calling the setMessage within a long computation and so the UI is not responsive. Could it be? However should not the status bar be updated when the task finished?
Previous Topic:how to add scroll bars to a details section in Master /Detail block
Next Topic:Problem with switch workspace
Goto Forum:
  


Current Time: Wed Apr 24 23:36:05 GMT 2024

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

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

Back to the top