Toolbar pulldown - item order [message #1019232] |
Fri, 15 March 2013 05:27  |
Eclipse User |
|
|
|
The elements in the MainToolbar of a Eclipse RCP application are made up declarative. When fragments are started, they contribute to the toolbar by adding a value to a pulldown, they add their portion also declarative.
But the order of the labels in the pulldown seems to be pure luck:
item1, item3, item2, item4, ...
Can I give them a predefined, fixed order? like "item1, item2, item3, item4"
To explain further more:
<!-- Main Plugin -->
<extension point="org.eclipse.ui.menus">
<toolbar id="de.example.mainToolbar">
<command
commandId="de.example.commands.item1"
icon="item1.png"
id="dropdowntoolbar.dropdown"
label="%app.command.label.item1"
style="pulldown"
mode="FORCE_TEXT"
tooltip="%app.command.tooltip.item1">
</command>
....
</toolbar>
<menuContribution
locationURI="menu:dropdowntoolbar.dropdown"
>
</menuContribution>
</extension>
each Fragment contributes to the command referencing via the menuContribution:
<!-- Fragment -->
<menuContribution locationURI="menu:dropdowntoolbar.dropdown">
<command
commandId="de.example.commands.item2"
icon="item1.png"
label="%app.command.label.item2"
mode="FORCE_TEXT"
style="push"
tooltip="%app.command.label.tooltip.item2">
</command>
</menuContribution>
|
|
|
Re: Toolbar pulldown - item order [message #1021740 is a reply to message #1019232] |
Wed, 20 March 2013 11:50  |
Eclipse User |
|
|
|
Hi Torsten,
I think that is caused by the order they are started and evaluated. I have no
solution. Maybe make the menu dynamic and add a listener to it that
reorganizes the entries?
In what order would you want them anyway? Alphabet? Is the order also
different between restarts?
Regards,
Wim
> The elements in the MainToolbar of a Eclipse RCP application are made up
declarative. When fragments are started, they contribute to the toolbar by
adding a value to a pulldown, they add their portion also declarative.
>
> But the order of the labels in the pulldown seems to be pure luck:
>
> item1, item3, item2, item4, ...
>
> Can I give them a predefined, fixed order? like "item1, item2, item3,
item4"
>
> To explain further more:
>
> <!-- Main Plugin -->
> <extension point="org.eclipse.ui.menus">
> <toolbar id="de.example.mainToolbar">
> <command
> commandId="de.example.commands.item1"
> icon="item1.png"
> id="dropdowntoolbar.dropdown"
> label="%app.command.label.item1"
> style="pulldown"
> mode="FORCE_TEXT"
> tooltip="%app.command.tooltip.item1">
> </command>
> ....
> </toolbar>
> <menuContribution
> locationURI="menu:dropdowntoolbar.dropdown"
>>
> </menuContribution>
> </extension>
> each Fragment contributes to the command referencing via the
menuContribution:
>
> <!-- Fragment -->
> <menuContribution locationURI="menu:dropdowntoolbar.dropdown">
> <command
> commandId="de.example.commands.item2"
> icon="item1.png"
> label="%app.command.label.item2"
> mode="FORCE_TEXT"
> style="push"
> tooltip="%app.command.label.tooltip.item2">
> </command>
> </menuContribution>
|
|
|
Powered by
FUDForum. Page generated in 0.03347 seconds