FAQ How do I write a message to the workbench status line?
When pressing Ctrl+j in a text editor, the editor enters incremental find mode and prints messages in the status bar in the lower left-hand corner.
This can be done from within any view as follows:
IActionBars bars = getViewSite().getActionBars(); bars.getStatusLineManager().setMessage("Hello");
Editors can access the status line via IEditorActionBarContributor, which is given a reference to an IActionBars instance in its init method. The contributor is accessed from an editor by using
Note that the status line is shared by all views and editors. When the active part changes, the status line updates to show the new active parts message.
Parts can also specify an error message on the status line, using the method setErrorMessage. The error message, if provided, always takes precedence over any nonerror message that was previously shown. When the error message is cleared, the nonerror message is put back on the status line.
This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.