Forwards to the first menu item in the specified menu. Forwards to the void controller if the
user has no permissions to view anything in that menu, i.e. the menu is empty.

@param menuId ID of the menu or plugin
508544
@SuppressWarnings("squid:S3752") // multiple methods required
  @RequestMapping(
      method = {RequestMethod.GET, RequestMethod.POST},
      value = "/{menuId}")
  public String forwardMenuDefaultPlugin(@Valid @NotNull @PathVariable String menuId, Model model) {
    Menu filteredMenu =
        menuReaderService
            .getMenu()
            .flatMap(menu -> menu.findMenu(menuId))
            .orElseThrow(
                () -> new RuntimeException("menu with id [" + menuId + "] does not exist"));
    model.addAttribute(KEY_MENU_ID, menuId);

    String pluginId = filteredMenu.firstItem().map(MenuItem::getId).orElse(VoidPluginController.ID);

    String contextUri = URI + '/' + menuId + '/' + pluginId;
    addModelAttributes(model, contextUri);
    return getForwardPluginUri(pluginId);
  }
802839
private void initUserMenu() {

        if (!m_user.isManaged()) {
            m_menu.addMenuEntry(
                CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_CHANGE_PASSWORD_BUTTON_0),
                null).addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        m_context.start(
                            CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_PWCHANGE_HEADER_0)
                                + m_user.getSimpleName(),
                            new CmsChangePasswordDialog(m_context));
                    }
                });
        }
        final CmsPreferencesDialogAction preferencesAction = new CmsPreferencesDialogAction();
        m_menu.addMenuEntry(preferencesAction.getTitle(A_CmsUI.get().getLocale()), null).addClickListener(
            new ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    preferencesAction.executeAction(m_context);
                }
            });
        if (!m_user.isManaged()) {
            m_menu.addMenuEntry(CmsVaadinUtils.getMessageText(Messages.GUI_USER_EDIT_0), null).addClickListener(
                new Button.ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        editUserData();
                    }
                });
        }
        m_menu.addMenuEntry(
            CmsVaadinUtils.getMessageText(org.opencms.workplace.explorer.Messages.GUI_EXPLORER_CONTEXT_LOGOUT_0),
            null).addClickListener(new Button.ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    logout();
                }
            });
    }
1148593
public void loadContextMenu(
        final CmsUUID structureId,
        final AdeContext context,
        final CmsContextMenuButton menuButton) {

        CmsRpcAction<List<CmsContextMenuEntryBean>> action = new CmsRpcAction<List<CmsContextMenuEntryBean>>() {

            @Override
            public void execute() {

                CmsCoreProvider.getService().getContextMenuEntries(structureId, context, this);
            }

            @Override
            protected void onResponse(List<CmsContextMenuEntryBean> result) {

                menuButton.showMenu(transformEntries(result, structureId));
            }
        };
        action.execute();
    }
280797
private MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) {
        final int ordering = getOrdering(categoryOrder);

        final MenuItemImpl item = new MenuItemImpl(this, group, id, categoryOrder,
                ordering, title, mDefaultShowAsAction);

        if (mCurrentMenuInfo != null) {
            // Pass along the current menu info
            item.setMenuInfo(mCurrentMenuInfo);
        }

        mItems.add(findInsertIndex(mItems, ordering), item);
        onItemsChanged(true);

        return item;
    }
432220
public function upAction($pageId, $menuName)
    {
        $pageMenuRepo = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMenu');
        $pageMenu = $pageMenuRepo->findOneBy(array('page' => $pageId, 'label' => $menuName));
        $position = $pageMenu->getPosition();
        if ($position > 1)
        {
            $pageMenuRepo->downMenuPagesPosition($menuName, $position - 1, $position);
            $pageMenu->setPosition($position - 1);
            $em = $this->getDoctrine()->getManager();
            $em->persist($pageMenu);
            $em->flush();
            $this->get('session')->getFlashBag()->add(
                    'notice',
                    $this->get('translator')->trans('fulgurio.lightcms.menus.moving_success_msg', array(), 'admin'));
        }
        return $this->redirect($this->generateUrl('AdminMenus'));
    }
839714
public function delConditional($menuid)
    {
        $url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['menuid' => $menuid]);
    }
1323
private void menuAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAboutActionPerformed
    JOptionPane.showMessageDialog(Main.getApplicationFrame(), new AboutPanel(), "About", JOptionPane.PLAIN_MESSAGE);
  }
1142611
public function listOrganizationMenuItems($organizationId, $menuId)
    {
        list($response) = $this->listOrganizationMenuItemsWithHttpInfo($organizationId, $menuId);
        return $response;
    }
1117619
public static function getUrlByMenuId($menuId)
    {
        $record = static::find()
            ->findByMenuId($menuId)
            ->innerJoinWith('menuUrl')
            ->one();

        $return = [];
        if ($record) {
            $return = $record->getMenuUrlData();
        }

        return $return;
    }
162328
public void createMenu(int menuId){
        mToolbar.inflateMenu(menuId);
        mMenuDataChanged = true;
        if(mAppCompatDelegate == null)
            onPrepareMenu();
    }
212346
@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		menu.add(0, MENU_LIMIT_SCROLLING_LAT_ID, Menu.NONE, "Latitude: Limit scrolling").setCheckable(true);
		menu.add(0, MENU_LIMIT_SCROLLING_LNG_ID, Menu.NONE, "Longitude: Limit scrolling").setCheckable(true);

		super.onCreateOptionsMenu(menu, inflater);
	}
803410
public void setMenuView(View view) {
        setMenuView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    }
1336011
public function update($id, MenuRequest $request)
    {
        try {
            $menu = $this->repository->find($id);

            if (empty($menu)) {
                Cms::notification('Menu not found', 'warning');

                return redirect(route($this->routeBase.'.menus.index'));
            }

            $menu = $this->repository->update($menu, $request->all());
            Cms::notification('Menu updated successfully.', 'success');

            if (!$menu) {
                Cms::notification('Menu could not be updated.', 'danger');
            }
        } catch (Exception $e) {
            Cms::notification($e->getMessage() ?: 'Menu could not be updated.', 'danger');
        }

        return redirect(route($this->routeBase.'.menus.edit', [$id]));
    }
1229976
private void updateRecentMenu() {
		menu.removeAllMenuItems();

		int index = 1;
		boolean first = true;

		for (Iterator<ExampleData> i = recent.iterator(); i.hasNext();) {
			ExampleData data = i.next();

			try {
				StringBuilder builder = new StringBuilder(Integer.toString(index++)).append(". ");

				if (data.getExampleGroupName() != null) {
					builder.append(data.getExampleGroupName()).append(" - ");
				}

				builder.append(data.getExampleName());
				addRecentExample(builder.toString(), data, first);
				first = false;
			} catch (Exception e) {
				i.remove();
				LogFactory.getLog(getClass()).error("Unable to read recent class: " + data.getExampleName());
			}
		}
	}
63027
private void forward() {

        try {
            CmsDbSettingsPanel panel = m_panel[0];
            panel.saveToSetupBean();

            boolean createDb = panel.getCreateDb();
            boolean dropDb = panel.getDropDb();
            boolean createTables = panel.getCreateTables();
            setupDb(createDb, createTables, dropDb);
        } catch (DBException e) {
            CmsSetupErrorDialog.showErrorDialog(e.getMessage(), e.getDetails());
        } catch (Exception e) {
            CmsSetupErrorDialog.showErrorDialog(e);
        }

    }
1010258
public static MenuItemTransitionBuilder transit(@IdRes int menuId, @NonNull Toolbar toolbar) {
        return new MenuItemTransitionBuilder(menuId, toolbar);
    }
414397
public function editItem($id)
    {
        $this->request->allowMethod(['get', 'put']);

        $menuItem = $this->MenuItems->get($id);
        if ($this->request->is('put') && !empty($this->request->data)) {
            $menuItem = $this->MenuItems->patchEntity($menuItem, $this->request->data);
            if ($this->MenuItems->save($menuItem)) {
                $this->Flash->success(__d('wasabi_core', 'Menu Item <strong>{0}</strong> has been updated.', $this->request->data['name']));
                $this->redirect(['action' => 'edit', $menuItem->get('menu_id')]);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set([
            'menu' => $this->Menus->get($menuItem->get('menu_id')),
            'menuItem' => $menuItem,
            'linkTypes' => $this->Menus->getLinkTypes()
        ]);
        $this->render('add_item');
    }