I agree, if you try to put MenuItemSeparator in, it will complain, stating that only MenuItem can be a child when GWT tries to create a widget. Since this is not currently supported, I suggest you request this as a future improvement to the GWT team.
In the meantime, you can add the separator programmatically and add the command as follows: XML file:
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> <g:HTMLPanel> <g:MenuBar ui:field="menuBar"> <g:MenuItem ui:field="helpMenuItem">Help</g:MenuItem> <g:MenuItem ui:field="aboutMenuItem">About</g:MenuItem> <g:MenuItem ui:field="siteMapMenuItem">Site Map</g:MenuItem> </g:MenuBar> </g:HTMLPanel>
Java file:
public class Menu extends Composite { ... @UiField MenuBar menuBar; @UiField MenuItem helpMenuItem; ... public Menu() { initWidget(uiBinder.createAndBindUi(this));
Elsewhere in my code, I implemented a HistoryListener to catch any changes, i.e.
class HistoryManager implements ValueChangeHandler<String> {
Nick
source share