Package com.liferay.nativity.modules.contextmenu.model

Examples of com.liferay.nativity.modules.contextmenu.model.ContextMenuItem


  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();
      }
View Full Code Here

TOP

Related Classes of com.liferay.nativity.modules.contextmenu.model.ContextMenuItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.