Removes given context menu item from the context menu. The given item can
be a root item or leaf item or anything in between. If given given is not
found from the context menu structure, this method has no effect.<p>

@param contextMenuItem the menu item
429027
public void removeItem(ContextMenuItem contextMenuItem) {

        if (!hasMenuItem(contextMenuItem)) {
            return;
        }

        if (contextMenuItem.isRootItem()) {
            getState().getRootItems().remove(contextMenuItem.m_state);
        } else {
            ContextMenuItem parent = contextMenuItem.getParent();
            parent.m_state.getChildren().remove(contextMenuItem.m_state);
        }

        Set<ContextMenuItem> children = contextMenuItem.getAllChildren();

        m_items.remove(contextMenuItem.m_state.getId());

        for (ContextMenuItem child : children) {
            m_items.remove(child.m_state.getId());
        }

        markAsDirty();
    }
625337
public boolean removeMenuItem (String command)
    {
        int icount = _items.size();
        for (int i = 0; i < icount; i++) {
            RadialMenuItem item = _items.get(i);
            if (item.command.equals(command)) {
                _items.remove(i);
                return true;
            }
        }

        return false;
    }
1368026
@SuppressWarnings("unchecked")
		@Override
	    public void fillContextMenu(IMenuManager menu) {
	        IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	        boolean hasClosedProjects = false;
	        Iterator<Object> resources = selection.iterator();

	        while (resources.hasNext() && (!hasClosedProjects)) {
	            Object next = resources.next();
	            IProject project = null;

	            if (next instanceof IProject) {
	                project = (IProject) next;
	            } else if (next instanceof IAdaptable) {
	                project = (IProject) ((IAdaptable) next).getAdapter(IProject.class);
	            }

	            if (project == null) {
	                continue;
	            }

	            if (!project.isOpen()) {
	                hasClosedProjects = true;
	            }
	        }

	        if (!hasClosedProjects) {
	            refreshAction.selectionChanged(selection);
	            menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, refreshAction);
	        }
	    }
412283
@Deprecated
	@Override
	public void remove(final WComponent item) {
		if (item instanceof MenuItem) {
			removeMenuItem((MenuItem) item);
		}
	}
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);
    }
827694
public void addMenuItem(Runnable item) {
        items.add(item);
        if (item instanceof Menu) {
        	((Menu) item).parent = this;
        }
    }
1112602
public ContextMenuItem addItem(Resource icon) {

        ContextMenuItem item = addItem("");
        item.setIcon(icon);
        return item;
    }
382696
public function removeMenuItem($alias, $parent = null)
    {
        if ($parent !== null) {
            if (!isset($this->_menuItems[$parent]) ||
                !isset($this->_menuItems[$parent]['children']) ||
                !isset($this->_menuItems[$parent]['children'][$alias])
            ) {
                return;
            }
            unset($this->_menuItems[$parent]['children'][$alias]);
            return;
        }

        if (!isset($this->_menuItems[$alias])) {
            return;
        }
        unset($this->_menuItems[$alias]);
    }
1277744
private synchronized void removeContext(final EvaluatorContext context) {
    this.contextStack.remove(context);
    this.contextIds.remove(context.getId());
  }
1256615
public function removeItem(GridItem $gridItem)
    {
        if ($this->items->contains($gridItem)) {
            $this->items->removeElement($gridItem);
        }
    }
837514
@Override
    public void destroy(Contextual<?> contextual) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "destroy(Contextual)", new Object[] { contextual, this });

        final Map<String, InstanceAndContext<?>> storage = getStorage(false);

        if (storage != null) {
            final String contextId = getContextualId(contextual);

            InstanceAndContext<?> data = this.getByContextual(storage, contextual);

            if (data != null) {
                storage.remove(contextId);
                destroyItem(contextId, data);
            }
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "destroy(Contextual)");
    }
1363827
public static void pruneMenus(BaseComponent parent) {
        while (parent != null && parent instanceof BaseMenuComponent) {
            if (parent.getChildren().isEmpty()) {
                BaseComponent newParent = parent.getParent();
                parent.destroy();
                parent = newParent;
            } else {
                break;
            }
        }
    }
1020227
function removeContextMenus (level) {
          while (_contextMenus.length && (!level || _contextMenus.length > level)) {
            var cm = _contextMenus.pop();
            $rootScope.$broadcast(ContextMenuEvents.ContextMenuClosed, { context: _clickedElement, contextMenu: cm });
            cm.remove();
          }
          if(!level) {
            $rootScope.$broadcast(ContextMenuEvents.ContextMenuAllClosed, { context: _clickedElement });
          }
        }
861527
function _setContextMenuItemsVisible(enabled, items) {
        items.forEach(function (item) {
            CommandManager.get(item).setEnabled(enabled);
        });
    }
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);
        }
    }
717864
public void setContextPath(String contextPath) {
		if (StringUtils.isNotEmpty(contextPath)) {
			if (contextPath.charAt(0) != '/') {
				contextPath = '/' + contextPath;
			}
			if (contextPath.charAt(contextPath.length() - 1) != '/') {
				contextPath = contextPath + '/';
			}
			this.contextPath = contextPath;
		} else {
			this.contextPath = null;
		}
	}
622214
function removeContext(contextToRemove) {
  if (contextToRemove && contextToRemove.length) {
    _previousContext = _context
    _removeItems(_context, contextToRemove)
    if (_isEmpty(context)) {
      _context = _defaultContext
    }
  }
  return _context
}