How to add separator to Eclipse RCP toolbar?

I would like to add a gap between two buttons on the Eclipse toolbar. Both of these buttons are defined in plugin.xml for the plugin. I tried to specify the delimiter according to the following XML fragment, but nothing is displayed.

<menuContribution locationURI="toolbar:com.bogus.viewId.MyView">
    <command
          commandId="com.bogus.filters.menu"
          icon="icons/filter.gif"
          label="Filter Menu"
          style="pulldown"
          tooltip="Filter Menu" />
 </menuContribution>
 <menuContribution locationURI="toolbar:com.bogus.viewId.MyView">
     <separator name="com.bogus.separator1" />
 </menuContribution>
 <menuContribution locationURI="toolbar:com.bogus.viewId.MyView">
    <command
          commandId="com.bogus.commands.dangerous"
          icon="icons/bomb.png"
          label="BOOM!"
          tooltip="BOOM!" />
 </menuContribution>

As a note, does anyone know where I can find a decent schema definition for the plugin.xml file? This is the best I could find so far, but its poor.

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/plugin_manifest.html

+3
source share
2 answers

So, it turns out that the separator element can have the “visible” attribute, and this should be set to true.

<separator name="com.bogus.separator1" visible="true" />

. plugin.xml.

+3

. .

<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
    <toolbar id="com.qas.testpage.toolbar">
        <separator name="com.qas.separator1" visible="true">
        </separator>
    </toolbar>
</menuContribution>
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
    <toolbar id="com.qas.testpage.toolbar">         
        <command commandId="com.qas.javatestsuite" icon="icons/qas/testjavasuite.png" tooltip="Create New Java TestSuite Project" id="com.qas.toolbar" label="Java Test Suite Project">
        </command>
    </toolbar>
</menuContribution>
0

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


All Articles