checks if the activeMenue is part of given component

@param component the AdminComponent which should contain the activeMenue
@param activeMenue the menue to check
@return
4128
public boolean hasMenuEntry(AdminComponent component, MenuEntry activeMenue) {
		if (null != component && null != component.getMainMenu()) {
			Optional<MenuEntry> result = component.getMainMenu().flattened()
					.filter(menu -> checkForNull(menu, activeMenue) ? menu.getName().equals(activeMenue.getName()): false)
					.findFirst();
			return result.isPresent();
		}
		return false;
	}
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;
    }
896974
public void addContextMenuComponentListener(
        CmsContextMenu.ContextMenuOpenedListener.ComponentListener contextMenuComponentListener) {

        addListener(
            ContextMenuOpenedOnComponentEvent.class,
            contextMenuComponentListener,
            ContextMenuOpenedListener.ComponentListener.MENU_OPENED_FROM_COMPONENT);
    }
912606
public JComponent getEditorMenuBar(){
		CommandGroup commandGroup = getCommandGroup(getMenuBarCommandGroupName());
		if(commandGroup == null){
			return null;
		}
		return commandGroup.createMenuBar();
	}
583258
private JMenu getSuperMenu (String name, int index) {
		JMenu superMenu = superMenus.get(name);
		if (superMenu == null) {
			// Use an ExtensionPopupMenu so child menus are dismissed
			superMenu = new ExtensionPopupMenu(name) {

				private static final long serialVersionUID = 6825880451078204378L;

				@Override
				public boolean isEnableForComponent(Component invoker) {
					return true;
				}
			};
			superMenus.put(name, superMenu);
			addMenuItem(superMenu, index);
		}
		return superMenu;
		
	}
777268
@Override
	public void actionPerformed(ActionEvent event) {
		JMenuItem item = (JMenuItem) event.getSource();

		if (item.isSelected()) {
			showColumn(item.getText());
		} else {
			hideColumn(item.getText());
		}
	}
1278124
def check_active(url, element, **kwargs):
    ''''''
    menu = yesno_to_bool(kwargs['menu'], 'menu')
    ignore_params = yesno_to_bool(kwargs['ignore_params'], 'ignore_params')

    # check missing href parameter
    if not url.attrib.get('href', None) is None:
        # get href attribute
        href = url.attrib['href'].strip()

        # href="#" is often used when links shouldn't be handled by browsers.
        # For example, Bootstrap uses this for expandable menus on
        # small screens, see
        # https://getbootstrap.com/docs/4.0/components/navs/#using-dropdowns
        if href == '#':
            return False

        # split into urlparse object
        href = urlparse.urlsplit(href)

        # cut off hashtag (anchor)
        href = href._replace(fragment='')

        # cut off get params (?key=var&etc=var2)
        if ignore_params:
            href = href._replace(query='')
            kwargs['full_path'] = urlparse.urlunsplit(
                urlparse.urlsplit(
                    kwargs['full_path']
                )._replace(query='')
            )

        # build urlparse object back into string
        href = urlparse.urlunsplit(href)

        # check empty href
        if href == '':
            # replace href with current location
            href = kwargs['full_path']
        # compare full_path with href according to menu configuration

        if menu:
            # try mark "root" (/) url as "active", in equals way
            if href == '/' == kwargs['full_path']:
                logic = True
            # skip "root" (/) url, otherwise it will be always "active"
            elif href != '/':
                # start with logic
                logic = (
                    kwargs['full_path'].startswith(href)
                    or
                    # maybe an urlquoted href was supplied
                    urlquote(kwargs['full_path']).startswith(href)
                    or
                    kwargs['full_path'].startswith(urlquote(href))
                )
            else:
                logic = False
        else:
            # equals logic
            logic = (
                kwargs['full_path'] == href
                or
                # maybe an urlquoted href was supplied
                urlquote(kwargs['full_path']) == href
                or
                kwargs['full_path'] == urlquote(href)
            )
        # "active" url found
        if logic:
            # check parent tag has "class" attribute or it is empty
            if element.attrib.get('class'):
                # prevent multiple "class" attribute adding
                if kwargs['css_class'] not in element.attrib['class']:
                    # append "active" class
                    element.attrib['class'] += ' {css_class}'.format(
                        css_class=kwargs['css_class'],
                    )
            else:
                # create or set (if empty) "class" attribute
                element.attrib['class'] = kwargs['css_class']
            return True
    # no "active" urls found
    return False
380800
public void removeMenuItem(SubMenuItem parent, MenuItem item) {
        SubMenuItem subMenu = (parent != null) ? parent : ROOT;

        synchronized (subMenuItems) {
            ArrayList<MenuItem> subMenuChildren = subMenuItems.get(subMenu);
            if (subMenuChildren == null) {
                throw new UnsupportedOperationException("Menu element not found");
            }

            subMenuChildren.remove(item);
            if (item.hasChildren()) {
                subMenuItems.remove(item);
            }
        }
        menuStates.remove(item.getId());
    }
89786
public boolean installed(Class<?> component) {
		Preconditions.checkArgument(component != null, 
				"Parameter 'component' must not be [" + component + "]");
		return installed.contains(component);
	}
18203
public List<AdminComponent> getComponents() {
		List<AdminComponent> result = new ArrayList<>();
		
		for (AdminComponent adminComponent : adminTool.getComponents()) {
			if (null != adminComponent.getMainMenu()) {
				Stream<MenuEntry> nonHiddenMenues = adminComponent.getMainMenu().flattened().filter(me -> !me.isHide());
				if (nonHiddenMenues.count() == 0L) {
					LOGGER.trace("all menu entries hidden for component: " + adminComponent.getDisplayName());
					//do not return this menu item, because all entries are hidden
					continue;
				}
				result.add(adminComponent);
			}
		}
		return result;
	}
773605
public function isMainMenuItemActive($item)
    {
        return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
    }
144147
public static boolean isHideNoSelectionOption(UIComponent component)
    {
        // check hideNoSelectionOption for literal value (String) or ValueExpression (Boolean)
        Object hideNoSelectionOptionAttr = component.getAttributes().get(
                JSFAttr.HIDE_NO_SELECTION_OPTION_ATTR);
        return ((hideNoSelectionOptionAttr instanceof String && "true"
                .equalsIgnoreCase((String) hideNoSelectionOptionAttr)) || 
                (hideNoSelectionOptionAttr instanceof Boolean && ((Boolean) hideNoSelectionOptionAttr)));
    }
1285752
public boolean hasPanelAccess(Panel panel, User user, DelfoiActionName actionName) {
    if (panel == null) {
      logger.warn("Panel was null when checking panel access");
      return false;
    }

    if (user == null) {
      logger.warn("User was null when checking panel access");
      return false;
    }

    if (isSuperUser(user)) {
      return true;
    }

    UserRole userRole = getPanelRole(user, panel);
    if (userRole == null) {
      return false;
    }

    DelfoiAction action = delfoiActionDAO.findByActionName(actionName.toString());
    
    if (action == null) {
      logger.info(String.format("ActionUtils.hasDelfoiAccess - undefined action: '%s'", actionName));
      return false;
    }

    return hasPanelAccess(panel, action, userRole);
  }
788458
public List<MenuItemSelectable> getSelectedMenuItems() {
		List<MenuItemSelectable> selectedItems = getComponentModel().selectedMenuItems;
		if (selectedItems == null || selectedItems.isEmpty()) {
			return Collections.emptyList();
		} else {
			return Collections.unmodifiableList(selectedItems);
		}
	}
766494
public static boolean shouldRenderChildren(UIComponent component) {
        for (int i = 0; i < component.getChildren().size(); i++) {
            if (component.getChildren().get(i).isRendered()) {
                return true;
            }
        }

        return false;
    }
1164706
public static SubMenuItem asSubMenu(MenuItem item) {
        return visitWithResult(item, new AbstractMenuItemVisitor<SubMenuItem>() {
            @Override
            public void visit(SubMenuItem item) {
                setResult(item);
            }

            @Override
            public void anyItem(MenuItem item) { /* ignored */ }
        }).orElse(null);
    }
647687
public static Menupopup getDesignContextMenu(BaseComponent component) {
        return component == null ? null : (Menupopup) component.getAttribute(CONTEXT_MENU);
    }