public List<ContextMenuItem> getContextMenuItems(String[] paths) {
_logger.debug("getMenuItems {}", paths);
int count = _random.nextInt(20) + 3;
ContextMenuItem parentMenuItem = new ContextMenuItem("Parent Menu");
for (int i = 0; i < count; i++) {
ContextMenuItem childMenu = new ContextMenuItem(
"Menu " + i, parentMenuItem);
childMenu.setHelpText("Help " + i);
ContextMenuAction action = new ContextMenuAction() {
@Override
public void onSelection(String[] paths) {
_logger.info("item clicked");
}
};
childMenu.setContextMenuAction(action);
if ((i % 2) == 1) {
childMenu.setEnabled(false);
}
if ((i > 0) && ((i % 3) == 0)) {
parentMenuItem.addSeparator();
}