Adds given context menu item into the sub menu of this item.<p>

@param contextMenuItem the menu item
338263
public void addSubMenuItem(CmsContextMenuItemWidget contextMenuItem) {

        if (!hasSubMenu()) {
            m_subMenu = new CmsContextMenuOverlay();
            m_subMenu.setOwner(m_rootComponent.getExtensionTarget());
            setStylePrimaryName("v-context-menu-item-basic-submenu");
        }

        contextMenuItem.setParentItem(this);
        m_subMenu.addMenuItem(contextMenuItem);
    }
213314
public Menu add(Menu m) {
        submenus.add(m);
        m.setParent(this);
        return m;
    }
861527
function _setContextMenuItemsVisible(enabled, items) {
        items.forEach(function (item) {
            CommandManager.get(item).setEnabled(enabled);
        });
    }
584856
public void installMenu() {

        // initialize the menu groups
        m_groupContainer.clear();

        // creates the context help menu
        CmsAdminMenuGroup helpMenu = new CmsAdminMenuGroup(
            "help",
            Messages.get().getBundle(getLocale()).key(Messages.GUI_ADMIN_MENU_HELP_GROUP_0));
        helpMenu.addMenuItem(new CmsAdminContextHelpMenuItem());
        addGroup(helpMenu);

        Iterator<CmsTool> itElems = getToolManager().getToolsForPath(
            this,
            getToolManager().getBaseToolPath(this),
            false).iterator();
        while (itElems.hasNext()) {
            CmsTool tool = itElems.next();
            // check visibility
            String link = tool.getHandler().getLink();
            if (link.indexOf("?") > 0) {
                link = link.substring(0, link.indexOf("?"));
            }
            if (!getCms().existsResource(link) || !tool.getHandler().isVisible(this)) {
                continue;
            }

            // cut out the base
            String path = tool.getHandler().getPath().substring(getToolManager().getBaseToolPath(this).length());
            // special case of the base tool
            if (CmsStringUtil.isEmpty(path)) {
                continue;
            }
            // skip initial '/'
            int pos = tool.getHandler().getPath().indexOf(CmsToolManager.TOOLPATH_SEPARATOR);
            // only install if at first level
            if (path.indexOf(CmsToolManager.TOOLPATH_SEPARATOR, pos + 1) < 0) {

                addItem(
                    tool.getHandler().getGroup(),
                    tool.getHandler().getShortName(),
                    tool.getHandler().getSmallIconPath(),
                    CmsToolManager.linkForToolPath(getJsp(), tool.getHandler().getPath()),
                    tool.getHandler().isEnabled(this)
                    ? tool.getHandler().getHelpText()
                    : tool.getHandler().getDisabledHelpText(),
                    tool.getHandler().isEnabled(this),
                    tool.getHandler().getPosition(),
                    CmsAdminMenu.DEFAULT_TARGET);
            }
        }
    }
645052
def contextMenuEvent(self, event):
        """"""
        self.opt_menu.popup(event.globalPos())
        event.accept()
406605
public JMenuItem addMenuItem(JMenu menu, String actionKey, char[] rgChars)
    {
        JMenuItem menuItem;
        Action action = (Action)this.get(actionKey);
        if (action == null)
            return null;
        menu.add(menuItem = new JMenuItem(action));
        char firstChar = ActionManager.getFirstChar((String)menuItem.getAction().getValue(Action.NAME), rgChars, false);
        if (firstChar != NO_CHAR)
            menuItem.setMnemonic(firstChar);
        menuItem.setHorizontalTextPosition(JButton.RIGHT);

        return menuItem;
    }
978402
protected void openPopup(final A_CmsContextMenuItem item) {

        m_popup.add(item.getSubMenu());
        m_popup.addAutoHidePartner(item.getElement());
        m_popup.setModal(false);
        m_popup.show();

        setSubMenuPosition(item);

        if (m_isFixed) {
            m_popup.setPositionFixed();
        }
    }
11883
public void setContextProperties(Map<String, String> contextProperties)
   {
      if (contextProperties != null) {
         this.contextProperties = new HashMap<String, String>(4);
         this.contextProperties.putAll(contextProperties);
      }
   }
1174093
public void addOrUpdateItem(int parentId, MenuItem item) {
        synchronized (subMenuItems) {
            getSubMenuById(parentId).ifPresent(subMenu-> {
                if(getMenuItems(subMenu).stream().anyMatch(it-> it.getId() == item.getId())) {
                    replaceMenuById(asSubMenu(subMenu), item);
                }
                else {
                    addMenuItem(asSubMenu(subMenu), item);
                }
            });
        }
    }
864655
def addMenuItem( self, newItem, atItem ):
        
        tree = self.uiMenuTREE
        
        if ( not atItem ):
            tree.addTopLevelItem(newItem)
            
        elif ( atItem.data(0, Qt.UserRole) == 'menu' ):
            atItem.addChild(newItem)
        
        elif ( atItem.parent() ):
            index = atItem.parent().indexOfChild(atItem)
            atItem.parent().insertChild(index + 1, newItem)
        
        else:
            index = tree.indexOfTopLevelItem(atItem)
            tree.insertTopLevelItem(index + 1, newItem)
220456
@Override
	public Menu getContextMenu() {
		if (menu == null) {
			menu = new Menu();
			menu.addItem(new NewFeatureAction(mapWidget, this));
			menu.addItem(new EditFeatureAction(mapWidget, this));
			menu.addItem(new DeleteFeatureAction(mapWidget, this));
			menu.addItem(new MenuItemSeparator());
			menu.addItem(new DeselectAllAction(mapWidget.getMapModel()));
		}
		return menu;
	}
766711
def contextMenuEvent(self, event):
        """"""
        self.menu.popup(event.globalPos())
        event.accept()
589798
public void addContextParam(final WebAppInitParam contextParam) {
		NullArgumentException.validateNotNull(contextParam, "Context param");
		NullArgumentException.validateNotNull(contextParam.getParamName(),
				"Context param name");
		NullArgumentException.validateNotNull(contextParam.getParamValue(),
				"Context param value");
		contextParams.add(contextParam);
	}
772023
def set_context_menu(self, context_menu):
        
        self.context_menu = context_menu
        self.context_menu.tree_view = self
        self.context_menu.init_actions()
        for action in self.context_menu.actions():
            self.addAction(action)
1282615
def _contextMenu(self, pos):
        
        # Create the context menu.
        menu = QMenu(self)
        menu.addAction(self._zoomBackAction)

        # Displaying the context menu at the mouse position requires
        # a global position.
        # The position received as argument is relative to PlotWidget's
        # plot area, and thus needs to be converted.
        plotArea = self.getWidgetHandle()
        globalPosition = plotArea.mapToGlobal(pos)
        menu.exec_(globalPosition)
720108
private void showContextMenu(ContextMenuEvent e) {
        ContextMenu menu = view.getContextMenu();
        double xOffset = view.getContextMenuXOffset();
        double yOffset = view.getContextMenuYOffset();

        menu.show(view, e.getScreenX() + xOffset, e.getScreenY() + yOffset);
    }
891812
@Override
    public void setContext(DisplayContext context) {
        super.setContext(context);
        if (!capitalizationInfoIsSet &&
              (context==DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU || context==DisplayContext.CAPITALIZATION_FOR_STANDALONE)) {
            initCapitalizationContextInfo(fLocale);
            capitalizationInfoIsSet = true;
        }
        if (capitalizationBrkIter == null && (context==DisplayContext.CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE ||
              (context==DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationOfRelativeUnitsForListOrMenu) ||
              (context==DisplayContext.CAPITALIZATION_FOR_STANDALONE && capitalizationOfRelativeUnitsForStandAlone) )) {
            capitalizationBrkIter = BreakIterator.getSentenceInstance(fLocale);
        }
    }