List of usage examples for com.vaadin.ui MenuBar.MenuItem isEnabled
@Override public boolean isEnabled()
From source file:org.opennms.features.topology.app.internal.menu.TopologyContextMenu.java
License:Open Source License
private void addItems(ItemAddBehaviour<ContextMenuItem> behaviour, MenuBar.MenuItem child) { ContextMenuItem contextMenuItem = behaviour.addItem(); contextMenuItem.setEnabled(child.isEnabled()); contextMenuItem.setSeparatorVisible(child.isSeparator()); if (child.getCommand() != null) { contextMenuItem/*from www.j a v a 2 s . co m*/ .addItemClickListener(contextMenuItemClickEvent -> child.getCommand().menuSelected(child)); } if (child.hasChildren()) { for (MenuBar.MenuItem eachChild : child.getChildren()) { addItems(() -> contextMenuItem.addItem(eachChild.getText(), eachChild.getIcon()), eachChild); } } }