[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: StatusBar .setMessage method availability

I did the following:

In my WorkbenchWindowAdvisor's postWindowOpen() method, I registered my listener like this:
<code>
new AS400ConnectionListener(getWindowConfigurer().getActionBarConfigurer().getStatusLineManager());
</code>


My listener has a constructor that takes the IStatusLineManager argument and sets it as an instance variable:
<code>
private IStatusLineManager manager;
public AS400ConnectionListener(IStatusLineManager manager) {
super();
this.manager = manager;
}
</code>


The net result is whenever my listener fires an event, it can gain access to the cached IStatusLineManager variable:
<code>
public void connected(ConnectionEvent arg0) { manager.setMessage(MyPlugin.getDefault().getImage(MyPlugin.IMG_AS400_AVAILABLE), "Connected to iSeries.");
}
</code>


If anyone has a better way of doing this I'd love to know about.

Martin Coetzee wrote:
Hi Guys

I've ben searching high and low. This is a dumb question I know. I've enable the statusbar for our RCP application. I've written logic that checks if the rcp application is connected to a server, and want to display the connectivity status in the status bar. hmm...the dumb question is, how do I access the status bar. I can't seem to find it in the Workbench API's. The only way is to access it via the getViewSite().getActionBars() method. Due to my class that check the connectivity, is not visible and in another thread, how would I place messages then?

Thanx
Martin Coetzee