Configures the list which is used to hold the combo box items in the
popup. This method is called when the UI class is created.
175166
@Override
    protected void configureList() {
        list.setFont(comboBox.getFont());
        list.setBorder(null);
        list.setCellRenderer(comboBox.getRenderer());
        list.setFocusable(false);
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        int selectedIndex = comboBox.getSelectedIndex();

        if (selectedIndex == -1) {
            list.clearSelection();
        } else {
            list.setSelectedIndex(selectedIndex);
            list.ensureIndexIsVisible(selectedIndex);
        }

        installListListeners();
    }
1273655
def init_match_settings(self):
        
        self.mode_type_combobox.addItems(game_mode_types)
        self.map_type_combobox.addItems(map_types)
880013
protected void setup(SuggestOracle suggestions) {

        if (itemBoxKeyDownHandler != null) {
            itemBoxKeyDownHandler.removeHandler();
        }

        list.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_LIST);
        this.suggestions = suggestions;
        final ListItem item = new ListItem();

        item.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_INPUT_TOKEN);

        suggestBox = new SuggestBox(suggestions, itemBox);
        suggestBox.addSelectionHandler(selectionEvent -> {
            Suggestion selectedItem = selectionEvent.getSelectedItem();
            itemBox.setValue("");
            if (addItem(selectedItem)) {
                ValueChangeEvent.fire(MaterialAutoComplete.this, getValue());
            }
            itemBox.setFocus(true);
        });

        loadHandlers();

        setLimit(this.limit);
        String autocompleteId = DOM.createUniqueId();
        itemBox.getElement().setId(autocompleteId);

        item.add(suggestBox);
        item.add(label);
        list.add(item);

        panel.add(list);
        panel.getElement().setAttribute("onclick",
                "document.getElementById('" + autocompleteId + "').focus()");
        panel.add(errorLabel);
        suggestBox.setFocus(true);
    }
708989
public final void setSelectionList(Object[] keys, Object[] labels)
    {
        selectionListKeys = keys;
        selectionListLabelMessages = createLabels(getId(), labels);
        combobox.setModel(new DefaultComboBoxModel(selectionListLabelMessages));
        selectItem(getValue());
    }
720428
public void configureListView(ListView listView) {
		this.listView = listView;
		this.listView.setOnScrollListener(new OnScrollListener() {

			int scrollPosition;

			@Override
			public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
				notifyScrollToAdditionalScrollListener(view, firstVisibleItem, visibleItemCount, totalItemCount);
				View topChild = view.getChildAt(0);

				int newScrollPosition;
				if (topChild == null) {
					newScrollPosition = 0;
				} else {
					newScrollPosition = view.getFirstVisiblePosition() * topChild.getHeight() - topChild.getTop();
				}
				if (Math.abs(newScrollPosition - scrollPosition) >= SCROLL_DIRECTION_CHANGE_THRESHOLD) {
					onScrollPositionChanged(scrollPosition, newScrollPosition);
				}

				scrollPosition = newScrollPosition;
			}

			@Override
			public void onScrollStateChanged(AbsListView view, int scrollState) {
				notifyScrollStateChangedToAdditionalScrollListener(view, scrollState);

			}
		});
	}
810027
private void applySettings() {
		container.reset();
		infoPanel.reset();

		// create the list of options.
		List<String> options = new ArrayList<>(Arrays.asList(OPTIONS_ARRAY));

		if (cbNullOption.isSelected()) {
			options.add(0, "");
		}

		// create the dropdown.
		final WDropdown dropdown = new WDropdown(options);

		// set the dropdown type.
		dropdown.setType((DropdownType) rbsDDType.getSelected());

		// set the selected option if applicable.
		String selected = (String) rgDefaultOption.getSelected();
		if (selected != null && !NONE.equals(selected)) {
			dropdown.setSelected(selected);
		}

		// set the width.
		if (nfWidth.getValue() != null) {
			dropdown.setOptionWidth(nfWidth.getValue().intValue());
		}

		// set the tool tip.
		if (tfToolTip.getText() != null && tfToolTip.getText().length() > 0) {
			dropdown.setToolTip(tfToolTip.getText());
		}

		// set misc options.
		dropdown.setVisible(cbVisible.isSelected());
		dropdown.setDisabled(cbDisabled.isSelected());

		// add the action for action on change, ajax and subordinate.
		if (cbActionOnChange.isSelected() || cbAjax.isSelected() || cbSubmitOnChange.isSelected()) {
			final WStyledText info = new WStyledText();
			info.setWhitespaceMode(WhitespaceMode.PRESERVE);
			infoPanel.add(info);

			dropdown.setActionOnChange(new Action() {
				@Override
				public void execute(final ActionEvent event) {
					String selectedOption = (String) dropdown.getSelected();
					info.setText(selectedOption);
				}
			});
		}

		// this has to be below the set action on change so it is
		// not over written.
		dropdown.setSubmitOnChange(cbSubmitOnChange.isSelected());

		// add the ajax target.
		if (cbAjax.isSelected()) {
			WAjaxControl update = new WAjaxControl(dropdown);
			update.addTarget(infoPanel);
			container.add(update);
		}

		// add the subordinate stuff.
		if (rbsDDType.getValue() == WDropdown.DropdownType.COMBO) {
			//This is to work around a WComponent Subordinate logic flaw.
			cbSubordinate.setSelected(false);
		}
		if (cbSubordinate.isSelected()) {
			WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
			container.add(group);
			WSubordinateControl control = new WSubordinateControl();
			container.add(control);

			for (String option : OPTIONS_ARRAY) {
				buildSubordinatePanel(dropdown, option, group, control);
			}

			// add a rule for none selected.
			Rule rule = new Rule();
			control.addRule(rule);
			rule.setCondition(new Equal(dropdown, ""));
			rule.addActionOnTrue(new Hide(group));
		}

		WFieldLayout flay = new WFieldLayout();
		flay.setLabelWidth(25);
		container.add(flay);
		flay.addField("Configured dropdown", dropdown);
		flay.addField((WLabel) null, new WButton("Submit"));
	}
1219452
void setUpOUComboBox(ComboBox combo) {

        combo.removeAllItems();
        try {
            if (m_site != null) {
                String siteOu = getSiteOU();
                combo.addItem(siteOu);
                combo.select(siteOu);
                combo.setEnabled(false);
            } else {
                combo.addItem("/");

                m_clonedCms.getRequestContext().setSiteRoot("");
                List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
                    m_clonedCms,
                    "/",
                    true);

                for (CmsOrganizationalUnit ou : ous) {

                    if (ouIsOK(ou)) {
                        combo.addItem(ou.getName());
                    }

                }
                combo.select("/");
            }

        } catch (CmsException e) {
            LOG.error("Error on reading OUs", e);
        }
        combo.setNullSelectionAllowed(false);
        combo.setTextInputAllowed(true);
        combo.setFilteringMode(FilteringMode.CONTAINS);
        combo.setNewItemsAllowed(false);

    }
721133
function SelectList(options) {
		this.options = $.extend({
			holder: null,
			maxVisibleItems: 10,
			selectOnClick: true,
			useHoverClass: false,
			useCustomScroll: false,
			handleResize: true,
			multipleSelectWithoutKey: false,
			alwaysPreventMouseWheel: false,
			indexAttribute: 'data-index',
			cloneClassPrefix: 'jcf-option-',
			containerStructure: '<span class="jcf-list"><span class="jcf-list-content"></span></span>',
			containerSelector: '.jcf-list-content',
			captionClass: 'jcf-optgroup-caption',
			disabledClass: 'jcf-disabled',
			optionClass: 'jcf-option',
			groupClass: 'jcf-optgroup',
			hoverClass: 'jcf-hover',
			selectedClass: 'jcf-selected',
			scrollClass: 'jcf-scroll-active'
		}, options);
		this.init();
	}
721179
private void setListSelection(int selectedIndex) {
        if (selectedIndex == -1) {
            list.clearSelection();
        } else {
            list.setSelectedIndex(selectedIndex);
            list.ensureIndexIsVisible(selectedIndex);
        }
    }
1209208
private void buildWidget() {
		// setTitle(MESSAGES.nearbyFeaturesListTooltip());
		setShowEmptyMessage(true);
		setWidth100();
		setHeight100();
		setShowHeader(false);
		setShowAllRecords(true);

		// List size calculation
		setDefaultWidth(400);
		setDefaultHeight(300);
		setAutoFitData(Autofit.BOTH);
		setAutoFitMaxRecords(MAX_ROWS);
		setAutoFitFieldWidths(true);
		setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);

		ListGridField labelField = new ListGridField(LABEL);
		ListGridField featIdField = new ListGridField(FEATURE_ID);
		ListGridField layerField = new ListGridField(LAYER_ID);
		ListGridField layerLabelField = new ListGridField(LAYER_LABEL);

		setGroupByField(LAYER_LABEL);

		setGroupStartOpen(GroupStartOpen.ALL);
		setFields(/* dummyIndentField, */labelField, layerField, featIdField, layerLabelField);
		hideField(LAYER_ID);
		hideField(FEATURE_ID);
		hideField(LAYER_LABEL);
		addRecordClickHandler(new RecordClickHandler() {

			public void onRecordClick(RecordClickEvent event) {
				String fId = event.getRecord().getAttribute(FEATURE_ID);
				String lId = event.getRecord().getAttribute(LAYER_ID);
				Feature feat = vectorFeatures.get(fId);

				if (feat != null) {
					featureClickHandler.onClick(feat, feat.getLayer());
				} else {
					Layer<?> rasterLayer = rasterLayers.get(lId);
					feat = rasterFeatures.get(fId);
					featureClickHandler.onClick(feat, rasterLayer);
				}
			}

		});

		setShowHover(true);
		setCanHover(true);
		setHoverWidth(200);
		setHoverCustomizer(new HoverCustomizer() {

			public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
				String fId = record.getAttribute(FEATURE_ID);
				Feature feat = vectorFeatures.get(fId);

				StringBuilder tooltip = new StringBuilder();

				if (feat != null) {
					for (AbstractAttributeInfo a : feat.getLayer().getLayerInfo().getFeatureInfo().getAttributes()) {
						if (a instanceof AbstractReadOnlyAttributeInfo &&
								((AbstractReadOnlyAttributeInfo) a).isIdentifying()) {
							tooltip.append("<b>");
							tooltip.append(((AbstractReadOnlyAttributeInfo) a).getLabel());
							tooltip.append("</b>: ");
							tooltip.append(feat.getAttributeValue(a.getName()));
							tooltip.append("<br/>");
						}
					}
					tooltip.append(MESSAGES.nearbyFeaturesListTooltip());
				}
				return tooltip.toString();
			}
		});
	}
1261651
public function init()
    {
        $this->fillFromConfig([
            'columns',
            'model',
            'recordUrl',
            'recordOnClick',
            'noRecordsMessage',
            'showPageNumbers',
            'recordsPerPage',
            'showSorting',
            'defaultSort',
            'showCheckboxes',
            'showSetup',
            'showTree',
            'treeExpanded',
            'showPagination',
            'customViewPath',
        ]);

        /*
         * Configure the list widget
         */
        $this->recordsPerPage = $this->getSession('per_page', $this->recordsPerPage);

        if ($this->showPagination == 'auto') {
            $this->showPagination = $this->recordsPerPage && $this->recordsPerPage > 0;
        }

        if ($this->customViewPath) {
            $this->addViewPath($this->customViewPath);
        }

        $this->validateModel();
        $this->validateTree();
    }
1192559
protected void init() {

        LinkedHashMap<String, String> sortList = getSortList();
        if (sortList != null) {
            m_sortSelectBox = new CmsSelectBox(sortList);
            m_sortSelectBox.addValueChangeHandler(this);
            m_sortSelectBox.addStyleName(DIALOG_CSS.selectboxWidth());
            m_sortSelectBox.truncate(TM_GALLERY_SORT, 200);
            m_options.add(m_sortSelectBox);
            Label infoLabel = new Label();
            infoLabel.setStyleName(DIALOG_CSS.infoLabel());
            m_infoLabel = infoLabel;
            m_options.insert(infoLabel, 0);
        }
        createQuickBox();

    }
1137913
def __initialize_ui(self):
        

        self.setAutoScroll(True)
        self.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.setIndentation(self.__tree_view_indentation)
        self.setDragDropMode(QAbstractItemView.DragOnly)
        self.setHeaderHidden(True)

        self.__set_default_ui_state()

        # Signals / Slots.
        self.model().modelReset.connect(self.__set_default_ui_state)
1099670
function() {

            // Storing the context of the widget
            var self = this,

                dataDisabled,

                optgroupClass,

                optgroupElement,

                iconClass,

                iconUrl,

                iconUrlClass,

                iconUrlStyle,

                // Declaring the variable that will hold all of the dropdown list option elements
                currentItem = "",

                originalElemId = self.originalElemId || "",

                // Creates an unordered list element
                createdList = $("<ul/>", {

                    // Sets the unordered list `id` attribute
                    "id": originalElemId && originalElemId + "SelectBoxItOptions",

                    "class": "selectboxit-options",

                    //Sets the unordered list `tabindex` attribute to -1 to prevent the unordered list from being focusable
                    "tabindex": -1

                }),

                currentDataSelectedText,

                currentDataText,

                currentDataSearch,

                currentText,

                currentOption,

                parent;

            // Checks the `showFirstOption` plugin option to determine if the first dropdown list option should be shown in the options list.
            if (!self.options["showFirstOption"]) {

                // Disables the first select box option
                self.selectItems.first().attr("disabled", "disabled");

                // Excludes the first dropdown list option from the options list
                self.selectItems = self.selectBox.find("option").slice(1);

            }

            // Loops through the original select box options list and copies the text of each
            // into new list item elements of the new dropdown list
            self.selectItems.each(function(index) {

                currentOption = $(this);

                optgroupClass = "";

                optgroupElement = "";

                dataDisabled = currentOption.prop("disabled");

                iconClass = currentOption.attr("data-icon") || "";

                iconUrl = currentOption.attr("data-iconurl") || "";

                iconUrlClass = iconUrl ? "selectboxit-option-icon-url": "";

                iconUrlStyle = iconUrl ? 'style="background-image:url(\'' + iconUrl + '\');"': "";

                currentDataSelectedText = currentOption.attr("data-selectedtext");

                currentDataText = currentOption.attr("data-text");

                currentText = currentDataText ? currentDataText: currentOption.text();

                parent = currentOption.parent();

                // If the current option being traversed is within an optgroup

                if(parent.is("optgroup")) {

                    optgroupClass = "selectboxit-optgroup-option";

                    if(currentOption.index() === 0) {

                         optgroupElement = '<span class="selectboxit-optgroup-header ' + parent.first().attr("class") + '"data-disabled="true">' + parent.first().attr("label") + '</span>';

                    }

                }

                currentOption.attr("value", this.value);

                // Uses string concatenation for speed (applies HTML attribute encoding)
                currentItem += optgroupElement + '<li data-id="' + index + '" data-val="' + self.htmlEscape(this.value) + '" data-disabled="' + dataDisabled + '" class="' + optgroupClass + " selectboxit-option " + ($(this).attr("class") || "") + '"><a class="selectboxit-option-anchor"><span class="selectboxit-option-icon-container"><i class="selectboxit-option-icon ' + iconClass + ' ' + (iconUrlClass || self.theme["container"]) + '"' + iconUrlStyle + '></i></span>' + (self.options["html"] ? currentText: self.htmlEscape(currentText)) + '</a></li>';

                currentDataSearch = currentOption.attr("data-search");

                // Stores all of the original select box options text inside of an array
                // (Used later in the `searchAlgorithm` method)
                self.textArray[index] = dataDisabled ? "": currentDataSearch ? currentDataSearch: currentText;

                // Checks the original select box option for the `selected` attribute
                if (this.selected) {

                    // Replaces the default text with the selected option text
                    self._setText(self.dropdownText, currentDataSelectedText || currentText);

                    //Set the currently selected option
                    self.currentFocus = index;

                }

            });

            // If the `defaultText` option is being used
            if ((self.options["defaultText"] || self.selectBox.attr("data-text"))) {

                var defaultedText = self.options["defaultText"] || self.selectBox.attr("data-text");

                // Overrides the current dropdown default text with the value the user specifies in the `defaultText` option
                self._setText(self.dropdownText, defaultedText);

                self.options["defaultText"] = defaultedText;

            }

            // Append the list item to the unordered list
            createdList.append(currentItem);

            // Stores the dropdown list options list inside of the `list` instance variable
            self.list = createdList;

            // Append the dropdown list options list to the dropdown container element
            self.dropdownContainer.append(self.list);

            // Stores the individual dropdown list options inside of the `listItems` instance variable
            self.listItems = self.list.children("li");

            self.listAnchors = self.list.find("a");

            // Sets the 'selectboxit-option-first' class name on the first drop down option
            self.listItems.first().addClass("selectboxit-option-first");

            // Sets the 'selectboxit-option-last' class name on the last drop down option
            self.listItems.last().addClass("selectboxit-option-last");

            // Set the disabled CSS class for select box options
            self.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(self.theme["disabled"]);

            self.dropdownImage.addClass(self.selectBox.attr("data-icon") || self.options["defaultIcon"] || self.listItems.eq(self.currentFocus).find("i").attr("class"));

            self.dropdownImage.attr("style", self.listItems.eq(self.currentFocus).find("i").attr("style"));

            //Maintains chainability
            return self;

        }
877434
function (cfg, ctxt, lineNumber) {
        var controller = new ariaWidgetsControllersSelectBoxController();
        this.$DropDownTextInput.constructor.call(this, cfg, ctxt, lineNumber, controller);
        this.controller.setListOptions(this._cfg.options);

        /**
         * Whether the width of the popup can be smaller than the field, when configured to be so. If false, the
         * popupWidth property will be overridden when it is smaller than the field width
         * @type Boolean
         * @protected
         */
        this._freePopupWidth = false;
        this._waiSuggestionsChangedListener = null;
    }
909825
function (settings) {
        var self = this;

        settings.autohide = true;
        settings.constrainToViewport = true;

        if (typeof settings.items === 'function') {
          settings.itemsFactory = settings.items;
          settings.items = [];
        }

        if (settings.itemDefaults) {
          var items = settings.items, i = items.length;

          while (i--) {
            items[i] = Tools.extend({}, settings.itemDefaults, items[i]);
          }
        }

        self._super(settings);
        self.classes.add('menu');
      }
1111857
public void show() {
        setListSelection(comboBox.getSelectedIndex());

        Point location = getPopupLocation();

        show(comboBox, location.x, location.y);

        // For some reason, this is needed to clear the old selection being
        // displayed. Calling list.clearSelection() doesn't cut it.
        list.repaint();
    }