开发者

vaadin submenu code for views

开发者 https://www.devze.com 2023-03-21 15:10 出处:网络
Hi i m added the File menu item creating the views, my code look like final Class viewClass : new Class[] { Dashboard.class,

Hi i m added the File menu item creating the views, my code look like

final Class viewClass : new Class[] { Dashboard.class,
Editor.class, Ticket.class, MockupView.class }) {
navigator.addView(viewClass.getSimpleName(), viewClass);
menu.addItem(viewClass.getSimpleName(), new MenuBar.Command() {

public void menuSelected(MenuItem selectedItem) {
navigator.navigateTo(viewClass);
}
});

but how to add sub menu item inside this menu, any one can help me if you provide me exam开发者_如何学JAVAple it will be great full for me


menu.addItem returns a reference to the new menu item, which you can then use to add child items:

MenuBar.MenuItem item = menu.addItem("Parent", null);
item.addItem("Child", null);


Everything you need to know is on this Vaadin documentation page

0

精彩评论

暂无评论...
验证码 换一张
取 消