我需要一些Google web工具包的幫助來製作一個包含擴展子菜單項的垂直菜單。GWT垂直菜單
我想創建一個垂直的菜單,炒菜喜歡上了showcase of GWT
我想這在左邊的菜單:
VerticalPanel vertpanel = new VerticalPanel();
MenuBar menubar = new MenuBar(true);//set to true so its set to vertical alignment
MenuBar subbar = new MenuBar(true);
MenuBar subbar2 = new MenuBar(true);
subbar.addItem("Fist item of submenu1", new AddEmployeeCommand());
subbar.addItem("Second item of submenu1", new AddEmployeeCommand());
subbar2.addItem("First item of submenu2", new AddEmployeeCommand());
subbar2.addItem("Second item of submenu2", new AddEmployeeCommand());
menubar.addItem("sub 1", subbar);
menubar.addItem("sub 2", subbar2);
vertpanel.add(menubar);
RootPanel.get().add(menubar);
但是,這並不工作,因爲菜單項目將不會擴大到展示他們的子項目。雖然它在我將其設置爲水平菜單欄時很有用,但這不是我想要的。