Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsGlobal IStatusLineManager.setMessage(...)
https://www.eclipse.org/forums/index.php/mv/msg/261221/753670/#msg_753670
I know this topic has been discussed several times now, but I'm not able to find any satisfying solution.
The question is : how can I put Eclipse Statusline messages to the UI without losing them by switching between views ?
In fact I'm using the statusline to display some main log entries (like 'loading of document blabla complete') which mostly are done by asynchronous actions in my application. So I really dont wanna to tie the Statusline to any view or editor. Messages in the statusline should be set from somewhere and should stay as long they aint overwritten. Actually a simple request, istnt it ?
Well, since thats not the reality with IStatusLineManager.setMessage(...) I've currently developed the following really really ugly workaround...
I've created a singleton class called MyStatusLineManager, which manages the actual IStatusLineManager. It provides the me with the methodes sendMessage(String) and sendErrorMessage(String), both methode cache the last String I sent to the Statusline, additionally there's a resendLastMessage() which re-sents the last Status String. Then in any view/editor, I'm utilizing the setFocus() methodes and trigger the MyStatusLineManager.getInstance().resendLastMessage().
Looks like the opposite of being smart, doesnt it? But since IStatusLineManager is unnecessarily tied to a view, this was the only option I found. But it has weeknesses, since on some occasions I see old status messages even if new should have been written. Might be related to the setFocus behaviour of editors, I havent done problem determination in detail yet. So this approach is not only ugly, its unreliable too.
Adding a Label to the Statusline and use this also doesnt help. I want to place it to the very bottom-left of the Statusline, but that space is reserved for the actual StatusMessages.
So I really like to use IStatusLineManager, but I wanna keep its contents when views/editors are changed.
"You can put your own status label in the trim using the
org.eclipse.ui.menus extension point, however, available from 3.3 onwards."
Can someone explain what to do exactly ?
Is that an approach to re-utilize the StatusMessage area in the StatusBar ?]]>thomasr Missing name2011-10-28T09:54:29-00:00