|Global IStatusLineManager.setMessage(...) [message #753670]
||Fri, 28 October 2011 09:49
| thomasr Missing name
Registered: December 2010
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.
Is there a way to do what I'm looking for ?
Thanks a lot in advance
Powered by FUDForum
. Page generated in 0.01744 seconds