Creates a searchable item that represents a metadata field found for a track.

@param menuItem the rendered menu item containing the searchable metadata field
@return the searchable metadata field
978378
private SearchableItem buildSearchableItem(Message menuItem) {
        return new SearchableItem((int) ((NumberField) menuItem.arguments.get(1)).getValue(),
                ((StringField) menuItem.arguments.get(3)).getValue());
    }
113113
public function menuItemLabelsAction($menu_item_id) {
        $em = $this->getDoctrine()->getManager();
        $labels = $em->getRepository('AmulenPageBundle:MenuItemLabel')->findBy(array("menuItem" => $menu_item_id));

        return array(
            'labels' => $labels,
        );
    }
654843
private void defineMenus(UIDefaults d) {
        d.put("menuItemBackgroundBase", new Color(0x5b7ea4));

        // Initialize Menu
        String c = PAINTER_PREFIX + "MenuPainter";
        String p = "Menu";
        d.put(p + ".contentMargins", new InsetsUIResource(1, 12, 2, 5));
        d.put(p + "[Disabled].textForeground", d.get("seaGlassDisabledText"));
        d.put(p + "[Enabled].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[Enabled+Selected].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[Enabled+Selected].backgroundPainter", new LazyPainter(c, MenuPainter.Which.BACKGROUND_ENABLED_SELECTED));
        d.put(p + "[Disabled].arrowIconPainter", new LazyPainter(c, MenuPainter.Which.ARROWICON_DISABLED));
        d.put(p + "[Enabled].arrowIconPainter", new LazyPainter(c, MenuPainter.Which.ARROWICON_ENABLED));
        d.put(p + "[Enabled+Selected].arrowIconPainter", new LazyPainter(c, MenuPainter.Which.ARROWICON_ENABLED_SELECTED));
        d.put(p + ".arrowIcon", new SeaGlassIcon(p + "", "arrowIconPainter", 9, 10));
        d.put(p + ".checkIcon", new SeaGlassIcon(p + "", "checkIconPainter", 6, 10));

        p = "Menu:MenuItemAccelerator";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));

        // We don't paint MenuBar backgrounds. Remove the painters.
        c = PAINTER_PREFIX + "MenuBarPainter";
        p = "MenuBar";
        d.put(p + ".contentMargins", new InsetsUIResource(2, 6, 2, 6));

        if (d.get(p + "[Enabled].backgroundPainter") != null) {
            d.remove(p + "[Enabled].backgroundPainter");
        }

        if (d.get(p + "[Enabled].borderPainter") != null) {
           d.remove(p + "[Enabled].borderPainter");
        }

        // Rossi: "Selected Menu" color changed to dark blue. Not tested with "unified" title/menu/toolbar
        c = PAINTER_PREFIX + "MenuItemPainter";
        p = "MenuBar:Menu";
        d.put(p + ".States", "Enabled,Selected,Disabled,NotUnified");
        d.put(p + ".NotUnified", new MenuNotUnified());
        d.put(p + ".contentMargins", new InsetsUIResource(1, 4, 2, 4));
        
        d.put(p + "[Disabled].textForeground", d.getColor("seaGlassDisabledText"));
        d.put(p + "[Enabled].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[Selected].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[Selected].backgroundPainter", new LazyPainter(c, MenuItemPainter.Which.BACKGROUND_MOUSEOVER_UNIFIED));

        d.put(p + "[Enabled+NotUnified].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[Enabled+Selected+NotUnified].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[Enabled+Selected+NotUnified].backgroundPainter", new LazyPainter(c, MenuItemPainter.Which.BACKGROUND_MOUSEOVER));

        p = "MenuBar:Menu:MenuItemAccelerator";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));

        // Initialize MenuItem
        c = PAINTER_PREFIX + "MenuItemPainter";
        p = "MenuItem";
        d.put(p + ".contentMargins", new InsetsUIResource(1, 12, 2, 13));
        d.put(p + ".textIconGap", new Integer(5));
        d.put(p + ".acceleratorFont", new DerivedFont("defaultFont", 1.0f, null, null));
        d.put(p + "[Disabled].textForeground", d.getColor("seaGlassDisabledText"));
        d.put(p + "[Enabled].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[MouseOver].backgroundPainter", new LazyPainter(c, MenuItemPainter.Which.BACKGROUND_MOUSEOVER));

        p = "MenuItem:MenuItemAccelerator";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[Disabled].textForeground", d.getColor("seaGlassDisabledText"));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));

        // Initialize CheckBoxMenuItem
        c = PAINTER_PREFIX + "CheckBoxMenuItemPainter";
        p = "CheckBoxMenuItem";
        d.put(p + ".contentMargins", new InsetsUIResource(1, 12, 2, 13));
        d.put(p + ".textIconGap", new Integer(5));
        d.put(p + "[Disabled].textForeground", d.getColor("seaGlassDisabledText"));
        d.put(p + "[Enabled].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[MouseOver].backgroundPainter", new LazyPainter(c, CheckBoxMenuItemPainter.Which.BACKGROUND_MOUSEOVER));
        d.put(p + "[MouseOver+Selected].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[MouseOver+Selected].backgroundPainter",
              new LazyPainter(c, CheckBoxMenuItemPainter.Which.BACKGROUND_SELECTED_MOUSEOVER));

        d.put(p + "[Disabled+Selected].checkIconPainter",
              new LazyPainter(c, CheckBoxMenuItemPainter.Which.CHECKICON_DISABLED_SELECTED));
        d.put(p + "[Enabled+Selected].checkIconPainter",
              new LazyPainter(c, CheckBoxMenuItemPainter.Which.CHECKICON_ENABLED_SELECTED));
// Rossi: Added painter that shows an "indicator" that menu item is a "selectable checkbox"
        d.put(p + "[Enabled].checkIconPainter",
            new LazyPainter(c, CheckBoxMenuItemPainter.Which.CHECKICON_ENABLED));
        d.put(p + "[MouseOver].checkIconPainter",
            new LazyPainter(c, CheckBoxMenuItemPainter.Which.CHECKICON_ENABLED_MOUSEOVER));
        d.put(p + "[MouseOver+Selected].checkIconPainter",
              new LazyPainter(c, CheckBoxMenuItemPainter.Which.CHECKICON_SELECTED_MOUSEOVER));
        d.put(p + ".checkIcon", new SeaGlassIcon(p, "checkIconPainter", 9, 10));

        p = "CheckBoxMenuItem:MenuItemAccelerator";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));

        // Initialize RadioButtonMenuItem
        c = PAINTER_PREFIX + "RadioButtonMenuItemPainter";
        p = "RadioButtonMenuItem";
        d.put(p + ".contentMargins", new InsetsUIResource(1, 12, 2, 13));
        d.put(p + ".textIconGap", new Integer(5));
        d.put(p + "[Disabled].textForeground", d.getColor("seaGlassDisabledText"));
        d.put(p + "[Enabled].textForeground", new ColorUIResource(Color.BLACK));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[MouseOver].backgroundPainter", new LazyPainter(c, RadioButtonMenuItemPainter.Which.BACKGROUND_MOUSEOVER));
        d.put(p + "[MouseOver+Selected].textForeground", new ColorUIResource(Color.WHITE));
        d.put(p + "[MouseOver+Selected].backgroundPainter",
              new LazyPainter(c, RadioButtonMenuItemPainter.Which.BACKGROUND_SELECTED_MOUSEOVER));
        
        d.put(p + "[Disabled+Selected].checkIconPainter",
              new LazyPainter(c, RadioButtonMenuItemPainter.Which.CHECKICON_DISABLED_SELECTED));
        d.put(p + "[Enabled+Selected].checkIconPainter",
              new LazyPainter(c, RadioButtonMenuItemPainter.Which.CHECKICON_ENABLED_SELECTED));
        // Rossi: Added painter that shows an "indicator" that menu item is a "selectable radio button"
        d.put(p + "[Enabled].checkIconPainter",
            new LazyPainter(c, RadioButtonMenuItemPainter.Which.CHECKICON_ENABLED));
        d.put(p + "[MouseOver].checkIconPainter",
            new LazyPainter(c, RadioButtonMenuItemPainter.Which.CHECKICON_ENABLED_MOUSEOVER));
        d.put(p + "[MouseOver+Selected].checkIconPainter",
              new LazyPainter(c, RadioButtonMenuItemPainter.Which.CHECKICON_SELECTED_MOUSEOVER));
        d.put(p + ".checkIcon", new SeaGlassIcon(p, "checkIconPainter", 9, 10));

        p = "RadioButtonMenuItem:MenuItemAccelerator";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + "[MouseOver].textForeground", new ColorUIResource(Color.WHITE));
    }
640376
public function addItem(\Wucdbm\Bundle\MenuBuilderBundle\Entity\MenuItem $item) {
        $this->items[] = $item;

        return $this;
    }
580118
protected static JMenuItem createItem (String name, Integer mnem, KeyStroke accel)
    {
        JMenuItem item = new JMenuItem(name);
        if (mnem != null) {
            item.setMnemonic(mnem.intValue());
        }
        if (accel != null) {
            item.setAccelerator(accel);
        }
        return item;
    }
626810
public static MenuItemTransitionBuilder transit(String id, @IdRes int menuId, @NonNull Toolbar toolbar) {
        return new MenuItemTransitionBuilder(id, menuId, toolbar);
    }
107137
@Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        super.onCreateOptionsMenu(menu, inflater);
        switchMenu = menu.add("Switch WMS Layer");
    }
589907
protected function generateMenuItem(ItemInterface $menuItem): Menu
    {
        return new Menu($menuItem, $this->dispatcher, $this->renderer);
    }
277842
public function createMenuItemAction(Request $request, Menu $menu)
    {
        $entity = new MenuItem();
        $entity->setMenu($menu);
        $form = $this->createMenuItemCreateForm($entity);
        $form->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            if($entity->getPage()){
                $entity->setPageSlug($entity->getPage());
            }

            $em->persist($entity);

            $this->get('amulen.page.service.menu')->reorder($menu);
            $em->flush();

            $availableLangs = $this->container->getParameter('flowcode_page.available_languages');
            foreach ($availableLangs as $key => $value) {
                $menuItemLabel = new MenuItemLabel();
                $menuItemLabel->setLang($key);
                $menuItemLabel->setContent($entity->getName());
                $menuItemLabel->setMenuItem($entity);
                $em->persist($menuItemLabel);
            }
            $em->flush();

            return $this->redirect($this->generateUrl('admin_menu_items', array('id' => $menu->getId())));
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
230694
private function createLinkManagerMenuItem(): ?ItemInterface
    {
        if (!$this->permissionResolver->hasAccess('url', 'view')) {
            return null;
        }

        return $this->factory->createItem(
            self::ITEM_CONTENT__LINK_MANAGER,
            [
                'route' => 'ezplatform.link_manager.list',
                'extras' => [
                    'routes' => [
                        'edit' => 'ezplatform.link_manager.edit',
                        'view' => 'ezplatform.link_manager.view',
                    ],
                ],
            ]
        );
    }
280777
private ZapMenuItem getMenuFind() {
        if (menuFind == null) {
            menuFind = new ZapMenuItem("menu.edit.find", getFindDefaultKeyStroke());

            menuFind.addActionListener(new java.awt.event.ActionListener() {
                @Override
                public void actionPerformed(java.awt.event.ActionEvent e) {
                    showFindDialog(getView().getMainFrame(), null);
                }
            });
        }
        return menuFind;
    }
1030910
public WebMenuItem getMenuItem(String menuName, String path){
		try{
			return menuItemPaths.get(menuName).get(path);
		}catch(Exception e){
			log.error("Error when getting menu item for: menuName='" + menuName + "', path='" + path + "'", e);
			return null;
		}
	}
524270
public function setMenuItem(\Amulen\PageBundle\Entity\MenuItem $menuItem = null) {
        $this->menuItem = $menuItem;

        return $this;
    }
70154
private android.view.MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) {
        final int ordering = getOrdering(categoryOrder);

        final MenuItem item = createNewMenuItem(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;
    }
285420
public function addProductionMenuItem(MenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();

        // Create productions menu item.
        $productions = $this->factory->createItem('menu_item.productions', [
            'route' => 'bkstg_production_admin_index',
            'extras' => [
                'icon' => 'list',
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($productions);

        // Create productions menu item.
        $list = $this->factory->createItem('menu_item.productions', [
            'route' => 'bkstg_production_admin_index',
            'extras' => [
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $productions->addChild($list);

        // Create productions menu item.
        $archive = $this->factory->createItem('menu_item.archive', [
            'route' => 'bkstg_production_admin_archive',
            'extras' => [
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $productions->addChild($archive);
    }
1036148
public function addMenuItem(Request $request, array $item, MenuItem $menu)
    {
        $attributes = array();

        // if the menu item has a name, add it as a css class.
        if ($name = $item['name']) {
            $attributes['class'] = $name;
        }
        if (empty($item['path'])) {
            $uri = null;
        } elseif (preg_match('!^(?:https?://|mailto:)!', $item['path'])) {
            $uri = $item['path'];
        } else {
            $baseUrl = $request->getBaseUrl();
            $uri = $baseUrl . '/' . ltrim($item['path'], '/');
        }

        $menuItem = $menu->addChild(
            $item['id'],
            array(
                'uri' => $uri,
                'attributes' => $attributes,
                'label' => $item['title']
            )
        );

        if (!empty($item['json_data'])) {
            $item['json_data'] = @json_decode($item['json_data']);
        }

        $menuItem->setExtras($item);
        return $menuItem;
    }
616086
function addItem(item = {}) {
    if (!item.id) {
        console.warn('Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.');
        return;
    }
    let el = doc.createElement('menuItem');
    // assign unique id
    item.attributes = _.assign({}, item.attributes, {
        id: item.id
    });
    // add all attributes
    setAttributes(el, item.attributes);
    // add title
    el.innerHTML = `<title>${(_.isFunction(item.name) ? item.name() : item.name)}</title>`;
    // add page reference
    el.page = item.page;
    // appends to the menu
    menuBarEl.insertBefore(el, null);
    // cache for later use
    itemsCache[item.id] = el;

    return el;
}