The entered control in the status bar is not displayed

I would like to put the control in the status bar of the workbench window. The whole process should be straightforward, but all I try to do is the status bar tab does not become visible.

Since I do not own the application, but simply connect the plug-in to the IDE, WorkbenchWindowAdvisor and friends are not parameters.

The extension point is as follows:

 <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 as follows:

 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 success (i.e. the status bar tab is not displayed):

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

I am absolutely sure that I see something very obvious, ...

+5
source share
1 answer

Try the following: 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 out the GoogleSearchControlContribution class in github

+5
source

Source: https://habr.com/ru/post/1212143/


All Articles