I would like to place a control in the status bar of the workbench window. The whole process should be straight-forward, but whatever I try, the status bar contribution does not become visible.
Because I do not own the application but just contrinbute a plug-in to the IDE, WorkbenchWindowAdvisor
and friends are not an option.
The extension point is this:
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:org.eclipse.ui.trim.status" allPopups="false">
<control class="MyContributionItem" id="myContributionItem" />
</menuContribution>
</extension>
and the MyContributionItem
class is like this:
public class MyContributionItem extends WorkbenchWindowControlContribution {
protected Control createControl( Composite parent ) {
Label label = new Label( parent, SWT.NONE );
label.setText( "STATUS BAR!" );
return label;
}
}
What I tried so far, all without sucess (i.e. the status bar contribution does not show up):
?after=org.eclipse.jface.action.StatusLineManager
to the locationURI
MyContributionItem#createControl()
, it is never reachedallPopups
attribute to true
I am quite sure that I am mising something very obvious, ...
A status bar is an area at the bottom of a primary window that displays information about the current window's state (such as what is being viewed and how), background tasks (such as printing, scanning, and formatting), or other contextual information (such as selection and keyboard state).
Status Bar, which is located on the lowermost line of the Word document window, is an area where key information about the current cursor position, such as the page number, column number, row number, section number, insert info, and modification info, is shown.
The status bar provides a location for the application developer to convey information to the user about what is happening in an application. For example, when an application is reading a file the status bar might display text which reads "Opening file....".
Status bar - One of the few bars at the bottom of the window that shows the status. Taskbar - The bar found at the bottom of the Microsoft Windows operating system since Windows 95. Title bar - A bar at the very top of a window that describes the program or window.
Try this: Plugin.xml
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.trim.status">
<toolbar
id="org.ancit.search.web.searchbar"
label="Search Bar">
<control
class="org.ancit.search.web.controlContributions.GoogleSearchControlContribution"
id="org.ancit.search.web.controlContributions.GoogleSearchControlContribution">
</control>
</toolbar>
</menuContribution>
</extension>
Check GoogleSearchControlContribution class on github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With