Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Contributed control to the status bar not visible

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):

  • added ?after=org.eclipse.jface.action.StatusLineManager to the locationURI
  • put a breakpoint in MyContributionItem#createControl(), it is never reached
  • target platform: Eclipse Platform SDK 3.8 or 4.4: makes no difference
  • changing the allPopups attribute to true

I am quite sure that I am mising something very obvious, ...

like image 890
Rüdiger Herrmann Avatar asked Sep 28 '22 21:09

Rüdiger Herrmann


People also ask

What can be shown on the status bar?

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).

Where is the status bar located?

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.

What is the utility of status bar control in Visual Basic?

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....".

What is status bar and task bar?

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.


1 Answers

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

like image 141
Chandrayya G K Avatar answered Oct 05 '22 08:10

Chandrayya G K