List of usage examples for com.vaadin.ui MenuBar.MenuItem getIcon
@Override
public Resource getIcon()
From source file:org.opennms.features.topology.app.internal.menu.TopologyContextMenu.java
License:Open Source License
private void addItems(MenuBar menuBar) { for (MenuBar.MenuItem eachItem : menuBar.getItems()) { addItems(() -> this.addItem(eachItem.getText(), eachItem.getIcon()), eachItem); }/* w w w . j av a 2 s .c om*/ }
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 w w w . j a v a 2 s .c o m*/ .addItemClickListener(contextMenuItemClickEvent -> child.getCommand().menuSelected(child)); } if (child.hasChildren()) { for (MenuBar.MenuItem eachChild : child.getChildren()) { addItems(() -> contextMenuItem.addItem(eachChild.getText(), eachChild.getIcon()), eachChild); } } }