gwt菜单栏问题

时间:2011-03-24 13:54:17

标签: css gwt uibinder

我想要的是菜单/导航栏,我可以将大部分元素放在左边,2个元素放在右边。是否可以使用菜单栏?

1 个答案:

答案 0 :(得分:2)

您可以使用DockLayoutPanel,每个部分都包含一个MenuBar,例如:

<g:DockLayoutPanel unit="PX">
  <g:west size="123">
    <g:MenuBar>
      <g:MenuItem>Item 1</g:MenuItem>
      <g:MenuItem>Item 2</g:MenuItem>
      <g:MenuItem>Item 3</g:MenuItem>
      ...
    </g:MenuBar>
  </g:west>
  <g:east size="123">
    <g:MenuBar>
      <g:MenuItem>Item (n-1)</g:MenuItem>
      <g:MenuItem>Item n</g:MenuItem>
    </g:MenuBar>
  </g:east>
  <g:center>
    (You can add anything in between here, including another MenuBar, if desired)
  </g:center>
</g:DockLayoutPanel>