Persistent StatusLine [message #314727] |
Fri, 20 April 2007 13:45  |
Eclipse User |
|
|
|
Originally posted by: michael.corr.sri.com
I have a simple RCP application with only 2 views. One has control buttons
(ControlView), the other is a console to display information. When a user
clicks on one of the control buttons, i'd like some summary state
information to be displayed in the StatusLine at the bottom of the
application.
However, I can only seem to get the statusline to appear when the view
with control buttons is in focus. If a user clicks on the other view, the
statusline disappears.
How can I get a text string to stay displayed in the StatusLine until I
explicitly clear it - regardless of which view is in focus?
I'm using the following code in my ControlView:
IStatusLineManager slm =
getViewSite().getActionBars().getStatusLineManager();
slm.setMessage("Process State: "+process.getState());
thanks,
Michael
|
|
|
|
Re: Persistent StatusLine [message #318916 is a reply to message #318727] |
Thu, 09 August 2007 04:22  |
Eclipse User |
|
|
|
Originally posted by: elca.ch.spam.businger.ch
Hi,
I didn't get any answer, but here's the solution I came up with:
I'm now adding a custom contribution item to the statusLineManager of
the workbenchWindow. This item is shown no matter which view, editor or
perspective is active in my application.
#### pseudo-code #######
// get the statusLineManager
window=((WorkbenchWindow)PlatformUI.getWorkbench().getActive WorkbenchWindow());
manager=window.getStatusLineManager();
// create the contributionItem with an id != null
item = createMyContributionItem(uniqueContributionItemId);
// add the item
manager.appendToGroup(manager.MIDDLE_GROUP,item);
....more code...
// replace the item
newItem = createOtherContributionItem(uniqueContributionItemId);
manager.replaceItem(uniqueContributionItemId,newItem);
....more code...
// get access to the item
manager.find(uniqueContributionItemId);
....more code...
// remove the item
manager.remove(uniqueContributionItemId);
....more code....
// refresh the statusLine after you're done making the changes.
manager.markDirty();
manager.update(true);
#### end pseudo-code #######
I hope this is useful for people with the same problem in the future.
|
|
|
Powered by
FUDForum. Page generated in 0.04701 seconds