Evaluates the default action if any for highlighting within the menu.<p>

@param items the menu items

@return the default action if available
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;
    }
1308473
public <T> void setItems(@NonNull List<T> items) {
    adapter = new MaterialSpinnerAdapter<>(getContext(), items)
        .setPopupPadding(popupPaddingLeft, popupPaddingTop, popupPaddingRight, popupPaddingBottom)
        .setBackgroundSelector(backgroundSelector)
        .setTextColor(textColor);
    setAdapterInternal(adapter);
  }
1299641
@Override
    public R visitUses(UsesTree node, P p) {
        return defaultAction(node, p);
    }
47086
public void fillDefault(List<CmsSitemapEntryBean> entries) {

        if (!m_disableFillDefault) {
            fill(entries);
            selectSite(m_handler.getDefaultSelectedSiteRoot());
        }
    }
861527
function _setContextMenuItemsVisible(enabled, items) {
        items.forEach(function (item) {
            CommandManager.get(item).setEnabled(enabled);
        });
    }
101616
public static <T> T first(List<T> items) {
        if(items != null && items.size() > 0) {
            return items.get(0);
        }

        return null;
    }
1199053
public FastItemAdapter<Item> add(int position, List<Item> items) {
        getItemAdapter().add(position, items);
        return this;
    }
94691
def get_actions_from_items(self, items):
        """"""
        fromcursor_act = create_action(self, text=_('Go to cursor position'),
                                       icon=ima.icon('fromcursor'),
                                       triggered=self.go_to_cursor_position)
        fullpath_act = create_action(self, text=_('Show absolute path'),
                                     toggled=self.toggle_fullpath_mode)
        fullpath_act.setChecked(self.show_fullpath)
        allfiles_act = create_action(self, text=_('Show all files'),
                                     toggled=self.toggle_show_all_files)
        allfiles_act.setChecked(self.show_all_files)
        comment_act = create_action(self, text=_('Show special comments'),
                                    toggled=self.toggle_show_comments)
        comment_act.setChecked(self.show_comments)
        group_cells_act = create_action(self, text=_('Group code cells'),
                                        toggled=self.toggle_group_cells)
        group_cells_act.setChecked(self.group_cells)
        sort_files_alphabetically_act = create_action(
            self, text=_('Sort files alphabetically'),
            toggled=self.toggle_sort_files_alphabetically)
        sort_files_alphabetically_act.setChecked(
            self.sort_files_alphabetically)
        actions = [fullpath_act, allfiles_act, group_cells_act, comment_act,
                   sort_files_alphabetically_act, fromcursor_act]
        return actions
1320648
public SuggestIndexResponse index(final SuggestItem[] items) {
        // TODO parallel?
        final SuggestItem[] array = Stream.of(items).filter(item -> !item.isBadWord(badWords)).toArray(n -> new SuggestItem[n]);

        try {
            final long start = System.currentTimeMillis();
            final SuggestWriterResult result = suggestWriter.write(client, settings, index, array, true);
            return new SuggestIndexResponse(items.length, items.length, result.getFailures(), System.currentTimeMillis() - start);
        } catch (Exception e) {
            throw new SuggestIndexException("Failed to write items[" + items.length + "] to " + index, e);
        }
    }
701476
@Deprecated
	public void setSelectedItems(final List<WComponent> selectedItems) {
		if (selectedItems == null || selectedItems.isEmpty()) {
			setSelectedMenuItems(null);
		} else {
			List<MenuItemSelectable> items = new ArrayList(selectedItems);
			setSelectedMenuItems(items);
		}
	}
858922
public void onItemClick() {
        if (selected) {
            selected = false;
            getView().reset();

            if (onResetCommand != null) {
                onResetCommand.execute();
            }
        }
        else {
            selected = true;
            getView().select();

            if (onSelectCommand != null) {
                onSelectCommand.execute();
            }
        }
    }
122737
public SimpleDialog multiChoiceItems(CharSequence[] items, int... selectedIndexes){
        if(mListView == null)
            initListView();

        mMode = MODE_MULTI_ITEMS;
        mAdapter.setItems(items, selectedIndexes);
        super.contentView(mListView);
        return this;
    }
959499
@Override
    public R visitReference(ReferenceTree node, P p) {
        return defaultAction(node, p);
    }
968010
public void playSequentially(List<Animator> items) {
        if (items != null && items.size() > 0) {
            mNeedsSort = true;
            if (items.size() == 1) {
                play(items.get(0));
            } else {
                for (int i = 0; i < items.size() - 1; ++i) {
                    play(items.get(i)).before(items.get(i+1));
                }
            }
        }
    }
1183376
public void setItems(java.util.Collection<DocumentationVersion> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<DocumentationVersion>(items);
    }
24408
protected void init(Map<String, String> items) {

        initWidget(m_panel);
        m_items = new LinkedHashMap<String, String>(items);
        m_panel.setStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().multiCheckBox());
        m_panel.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().textMedium());
        FocusHandler focusHandler = new FocusHandler() {

            public void onFocus(FocusEvent event) {

                CmsDomUtil.fireFocusEvent(CmsMultiCheckBox.this);
            }
        };
        for (Map.Entry<String, String> entry : items.entrySet()) {
            String value = entry.getValue();
            CmsCheckBox checkbox = new CmsCheckBox(value);
            // wrap the check boxes in FlowPanels to arrange them vertically
            FlowPanel checkboxWrapper = new FlowPanel();
            checkboxWrapper.add(checkbox);
            checkbox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

                public void onValueChange(ValueChangeEvent<Boolean> valueChanged) {

                    fireValueChanged(getFormValueAsString());
                }
            });
            checkbox.getButton().addFocusHandler(focusHandler);
            m_panel.add(checkboxWrapper);
            m_checkboxes.add(checkbox);
        }
        m_panel.add(m_error);
    }
38658
private static Collection<ActionRef> getActionsInCommon(List<Selectable> selection)
    {
        final Collection<ActionRef> actions = new HashSet<>();
        final int n = selection.size();
        for (int i = 0; i < n; i++)
        {
            final Selectable selectable = selection.get(i);
            if (selectable.hasFeature(Actioner.class))
            {
                final Actioner actioner = selectable.getFeature(Actioner.class);
                checkActionsInCommon(actioner, actions);
            }
        }
        return actions;
    }