List of usage examples for com.google.gwt.user.client.ui MenuBar selectItem
public void selectItem(MenuItem item)
From source file:com.colinalworth.xmlview.client.XmlTreeViewModel.java
License:Apache License
/** * /* ww w. jav a 2 s .c om*/ * @param validator */ public XmlTreeViewModel(XmlValidator validator) { final MenuBar subMenu = new MenuBar(true); subMenu.addItem(i18n.delete(), new DeleteElementCommand()); subMenu.addSeparator(); subMenu.addItem(i18n.addElement(), new NewElementCommand()); subMenu.addItem(i18n.addAttr(), new NewAttrCommand()); subMenu.addItem(i18n.addText(), new NewTextCommand()); contextMenu = new XmlEditContextMenu(); contextMenu.setWidget(subMenu); contextMenu.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { subMenu.selectItem(null); } }); nodeCell = new ElementCell(validator, contextMenu); refreshAccess = new HashMap<Node, ValueUpdater<Node>>(); }