Gets the default accelerator of the given menu, taken into account duplicated default accelerators.

@param menuItem the menu item to return the default accelerator
@return the KeyStroke or {@code null} if duplicated or does not have a default.
161605
private KeyStroke getDefaultAccelerator(ZapMenuItem menuItem) {
		if (isIdentifierWithDuplicatedAccelerator(menuItem.getIdentifier())) {
			return null;
		}
		return menuItem.getDefaultAccelerator();
	}
11287
public function &addItem(MenuItem $menu_item)
    {
        $this->items[$menu_item->getName()] = $menu_item;

        return $this->items[$menu_item->getName()];
    }
460408
@CheckForNull
  public String getPluginKey(Object extension) {
    return keysByClassLoader.get(extension.getClass().getClassLoader());
  }
204923
public JMenu getMenuReport() {
		if (menuReport == null) {
			menuReport = new JMenu();
			menuReport.setText(Constant.messages.getString("menu.report")); // ZAP: i18n
			menuReport.setMnemonic(Constant.messages.getChar("menu.report.mnemonic"));
		}
		return menuReport;
	}
351611
public static int eepromSizeForItem(MenuItem item) {
        return MenuItemHelper.visitWithResult(item, new AbstractMenuItemVisitor<Integer>() {
            @Override
            public void visit(AnalogMenuItem item) {
                setResult(2);
            }

            @Override
            public void visit(BooleanMenuItem item) {
                setResult(1);
            }

            @Override
            public void visit(EnumMenuItem item) {
                setResult(2);
            }

            @Override
            public void visit(TextMenuItem item) {
                setResult(item.getTextLength());
            }

            @Override
            public void anyItem(MenuItem item) {
                setResult(0);
            }
        }).orElse(0);
    }
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;
	}
620432
private void createMenuEntry(
        MenuItem parent,
        final CmsTreeNode<I_CmsContextMenuItem> node,
        CmsContextMenuTreeBuilder treeBuilder) {

        Command entryCommand = null;
        if (node.getChildren().size() == 0) {
            entryCommand = new Command() {

                private static final long serialVersionUID = 1L;

                public void menuSelected(MenuItem selectedItem) {

                    node.getData().executeAction(getDialogContext());
                }
            };
        }
        MenuItem entry = parent.addItem((node.getData().getTitle(A_CmsUI.get().getLocale())), entryCommand);
        for (CmsTreeNode<I_CmsContextMenuItem> child : node.getChildren()) {
            createMenuEntry(entry, child, treeBuilder);
        }
        if (treeBuilder.getVisibility(node.getData()).isInActive()) {
            entry.setEnabled(false);
        }
    }
633472
private Drawable getDefaultIcon1(Cursor cursor) {
        // Check the component that gave us the suggestion
        Drawable drawable = getActivityIconWithCache(mSearchable.getSearchActivity());
        if (drawable != null) {
            return drawable;
        }

        // Fall back to a default icon
        return mContext.getPackageManager().getDefaultActivityIcon();
    }
361839
public javax.swing.JMenu getMenuImport() {
		if (menuImport == null) {
			menuImport = new javax.swing.JMenu();
			menuImport.setText(Constant.messages.getString("menu.import"));
			menuImport.setMnemonic(Constant.messages.getChar("menu.import.mnemonic"));
		}
		return menuImport;
	}
1247012
public MenuItemSelectable getSelectedMenuItem() {
		List<MenuItemSelectable> selectedItems = getSelectedMenuItems();
		if (selectedItems.isEmpty()) {
			return null;
		} else {
			return selectedItems.get(0);
		}
	}
175304
private I_CmsContextMenuItem findDefaultAction(Collection<I_CmsContextMenuItem> items) {

        I_CmsContextMenuItem result = null;
        int resultRank = -1;
        for (I_CmsContextMenuItem menuItem : items) {
            if ((menuItem instanceof CmsContextMenuActionItem)
                && (((CmsContextMenuActionItem)menuItem).getWorkplaceAction() instanceof I_CmsDefaultAction)) {
                I_CmsDefaultAction action = (I_CmsDefaultAction)((CmsContextMenuActionItem)menuItem).getWorkplaceAction();
                if (getVisibility(menuItem).isActive()) {
                    if (result == null) {
                        result = menuItem;
                        resultRank = action.getDefaultActionRank(m_context);
                    } else {
                        int rank = action.getDefaultActionRank(m_context);
                        if (rank > resultRank) {
                            result = menuItem;
                            resultRank = rank;
                        }
                    }
                }
            }
        }
        return result;
    }
1010258
public static MenuItemTransitionBuilder transit(@IdRes int menuId, @NonNull Toolbar toolbar) {
        return new MenuItemTransitionBuilder(menuId, toolbar);
    }
612528
public boolean execute(Canvas target, Menu menu, MenuItem item) {
		FeatureTransaction featureTransaction = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
		if (featureTransaction != null) {
			boolean operationCount = featureTransaction.getOperationQueue().size() > 0;
			if (operationCount) {
				// The first addCoordinateOp may not be undone!
				FeatureOperation firstOperation = featureTransaction.getOperationQueue().get(0);
				if (firstOperation instanceof AddCoordinateOp) {
					if (featureTransaction.getNewFeatures()[0].getGeometry().getNumPoints() == 1) {
						return false;
					}
				}

				return true;
			}
		}
		return false;
	}
465002
public static CmsListIndependentAction getDefaultExplorerSwitchAction() {

        CmsListIndependentAction defAction = new CmsListIndependentAction(ACTION_EXPLORER_SWITCH_ID);
        defAction.setName(Messages.get().container(Messages.GUI_LIST_ACTION_EXPLORER_SWITCH_NAME_0));
        defAction.setHelpText(Messages.get().container(Messages.GUI_LIST_ACTION_EXPLORER_SWITCH_HELP_0));
        defAction.setConfirmationMessage(Messages.get().container(Messages.GUI_LIST_ACTION_EXPLORER_SWITCH_CONF_0));
        defAction.setIconPath("list/explorer.png");
        defAction.setEnabled(true);
        defAction.setVisible(true);
        return defAction;
    }
783736
public MenuConfig getMenuConfig() {
        String url = WxEndpoint.get("url.menu.get.self");
        String content = wxClient.get(url);
        logger.debug("get menu config: {}", content);
        return JsonMapper.nonEmptyMapper().fromJson(content, MenuConfig.class);
    }
1127263
public java.lang.String getBetaSettingsOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetBetaSettings().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
924825
public static ULocale getDefault() {
        synchronized (ULocale.class) {
            if (defaultULocale == null) {
                // When Java's default locale has extensions (such as ja-JP-u-ca-japanese),
                // Locale -> ULocale mapping requires BCP47 keyword mapping data that is currently
                // stored in a resource bundle. However, UResourceBundle currently requires
                // non-null default ULocale. For now, this implementation returns ULocale.ROOT
                // to avoid the problem.

                // TODO: Consider moving BCP47 mapping data out of resource bundle later.

                return ULocale.ROOT;
            }
            Locale currentDefault = Locale.getDefault();
            if (!defaultLocale.equals(currentDefault)) {
                defaultLocale = currentDefault;
                defaultULocale = forLocale(currentDefault);

                if (!JDKLocaleHelper.hasLocaleCategories()) {
                    // Detected Java default Locale change.
                    // We need to update category defaults to match the
                    // Java 7's behavior on Java 6 or older environment.
                    for (Category cat : Category.values()) {
                        int idx = cat.ordinal();
                        defaultCategoryLocales[idx] = currentDefault;
                        defaultCategoryULocales[idx] = forLocale(currentDefault);
                    }
                }
            }
            return defaultULocale;
        }
    }