Builds the HTML code for a select widget given a bean containing the select options

@param htmlAttributes html attributes for the select widget
@param options the bean containing the select options

@return the HTML for the select box
488888
String buildSelect(String htmlAttributes, SelectOptions options) {

        return buildSelect(htmlAttributes, options.getOptions(), options.getValues(), options.getSelectedIndex());
    }
1326827
def as_select(self, _items=None, **kwargs):
        
        attrs = self.extra.copy()
        attrs.update(kwargs)
        attrs['name'] = self.name
        if not self.optional:
            attrs['required'] = True
        html = [u'<select %s>' % get_html_attrs(attrs)]
        values = [self.to_string(**attrs)] or []
        items = _items or self.items

        for item in items:
            if isinstance(item, list):
                html.extend(self._render_optgroup(item, values))
            else:
                html.append(self._render_option(item, values))
        html.append(u'</select>')

        return Markup('\n'.join(html))
547886
protected function renderOptions(array $options, $selection)
	{
		$html = '';

		foreach($options as $key => $val) {
			if(is_array($val) === false) {
				$selected = ($key == $selection) ? ' selected' : null;
				$html .= '<option value="' . $key . '"' . $selected . '>' . $val . '</option>';
			} else {
				$html .= '<optgroup label="' . $key . '">' . $this->renderOptions($val, $selection) . '</optgroup>';
			}
		}

		return $html;
	}
1172125
public String buildSelectExplorerButtonStyle(String htmlAttributes) {

        int selectedIndex = Integer.parseInt(getParamTabExButtonStyle());
        return buildSelectButtonStyle(htmlAttributes, selectedIndex);
    }
1073563
public String buildHtmlHelpEnd() {

        StringBuffer result = new StringBuffer(4);
        result.append("</body>\n");
        result.append("</html>");
        return result.toString();
    }
204875
public static String browse(Option option) {
        String htmlPath = exportToHtml(option);
        //处理
        try {
            browse(htmlPath);
        } catch (Exception e) {
        }
        return htmlPath;
    }
1307186
function FormSelect(el, options) {
      _classCallCheck(this, FormSelect);

      // Don't init if browser default version
      var _this68 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options));

      if (_this68.$el.hasClass('browser-default')) {
        return _possibleConstructorReturn(_this68);
      }

      _this68.el.M_FormSelect = _this68;

      /**
       * Options for the select
       * @member FormSelect#options
       */
      _this68.options = $.extend({}, FormSelect.defaults, options);

      _this68.isMultiple = _this68.$el.prop('multiple');

      // Setup
      _this68.el.tabIndex = -1;
      _this68._keysSelected = {};
      _this68._valueDict = {}; // Maps key to original and generated option element.
      _this68._setupDropdown();

      _this68._setupEventHandlers();
      return _this68;
    }
1326922
public function HTMLToDOCX($html, GrabzItDOCXOptions $options = null)
	{
		if ($options == null)
		{
			$options = new GrabzItDOCXOptions();
		}

		$this->request = new GrabzItRequest($this->getRootUrl(true) . GrabzItClient::TakeDOCX, true, $options, $html);
	}
1205499
public function openFormActions($options = array())
    {
        $options = $this->appendClassToOptions('form-actions', $options);

        return '<div' . $this->html->attributes($options) . '>';
    }
243748
public static void html(StringBuilder sb, String html) {
        for (int i = 0; i < html.length(); i++) {
            char c = html.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            case '\'':
                sb.append("&apos;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            default:
                sb.append(c);
            }
        }
    }
960595
public static function activeCheckBox($model, $attribute, $htmlOptions = array())
    {
        $label = TbArray::popValue('label', $htmlOptions, false);
        $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
        $input = parent::activeCheckBox($model, $attribute, $htmlOptions);
        if (TbArray::popValue('useContainer', $htmlOptions, false)) {
            return self::tag(
                'div',
                array('class' => 'checkbox'),
                self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions)
            );
        } else {
            return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
        }
    }
426474
public static function dropDownList($name, $select, $data, $htmlOptions = array())
    {
        $displaySize = TbArray::popValue('displaySize', $htmlOptions);

        // In case we do need to create a div container for the input element (i.e. has addon or defined col)
        $containerOptions = array();

        // Get the intended input width before the rest of the options are normalized
        self::addSpanClass($htmlOptions);
        self::addColClass($htmlOptions);
        $col = self::popColClasses($htmlOptions);

        $htmlOptions = self::normalizeInputOptions($htmlOptions);
        self::addCssClass('form-control', $htmlOptions);
        if (!empty($displaySize)) {
            $htmlOptions['size'] = $displaySize;
        }

        if (!empty($col)) {
            self::addCssClass($col, $containerOptions);
        }

        $output = '';

        if (!empty($containerOptions)) {
            $output .= self::openTag('div', $containerOptions);
        }
        $output .= parent::dropDownList($name, $select, $data, $htmlOptions);

        if (!empty($containerOptions)) {
            $output .= '</div>';
        }

        return $output;
    }
1142450
public ElementActionBuilder select(String ... options) {
        DropDownSelectAction action = new DropDownSelectAction();
        action.setOptions(Arrays.asList(options));
        action(action);
        return new ElementActionBuilder(action);
    }
946768
public String buildSelectExplorerFileEntries(String htmlAttributes) {

        String emptyOption = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerFileEntryOptions();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(emptyOption)) {
            emptyOption = "50,100,200,300,400,500";
        }
        // remove all non digits without ','
        emptyOption = emptyOption.replaceAll("[^0-9|^,]", "");
        // remove all empty entries
        emptyOption = emptyOption.replaceAll(",,", ",");
        List<String> opts = CmsStringUtil.splitAsList(emptyOption, ",", true);
        opts.add(key(Messages.GUI_LABEL_UNLIMITED_0));
        opts.remove("0");
        List<String> vals = CmsStringUtil.splitAsList(emptyOption, ",", true);
        vals.add("" + Integer.MAX_VALUE);
        vals.remove("0");
        int selectedIndex = 2;
        for (int i = 0; i < vals.size(); i++) {
            if (vals.get(i).equals(getParamTabExFileEntries())) {
                selectedIndex = i;
                break;
            }
        }
        return buildSelect(htmlAttributes, opts, vals, selectedIndex);
    }
67886
function(options) {
        var thead = $('<thead><tr></tr></thead><tbody></tbody>'),
            column = options.column,
            columnCount = column.length;

        this.rowSpan = 1;

        for (var i = 0; i < columnCount; i++) {
            var col = column[i];

            if (typeof col.visible !== 'undefined' && !col.visible) {
                continue;
            }

            if (!$.isArray(col.content)) {
                col.content = [col.content];
            }
            if (col.content.length > this.rowSpan) {
                this.rowSpan = col.content.length;
            }

            var th = $('<th nowrap></th>').attr({
                width: col.width,
                field: col.field
            });
            if (options.flexible) {
                th.removeAttr('nowrap width');
            }

            var title = (col.escapeTitle === false) ? col.title : escapeHTML(col.title);
            if (col.sortable) {
                var wrap = $('<div class="sortable"></div>').html(title);
                if (col.currentSort) {
                    wrap.attr(col.currentSort, '');
                }
                title = wrap.prop('outerHTML');
            }

            thead.find('tr').append(th.html(title).prop('outerHTML'));
        }

        return thead.prop('outerHTML');
    }
958284
public DetailHtmlBuilder executeHtml(ActionContext context, DetailHtmlBuilder htmlBuilder, StringifierFactory htmlStringifierFactory, Simon simon) throws IOException {
		return htmlBuilder;
	}
141228
public function select(
        $name,
        $list = [],
        $selected = null,
        array $selectAttributes = [],
        array $optionsAttributes = [],
        array $optgroupsAttributes = []
    ) {
        $this->type = 'select';

        // When building a select box the "value" attribute is really the selected one
        // so we will use that when checking the model or session for a value which
        // should provide a convenient method of re-populating the forms on post.
        $selected = $this->getValueAttribute($name, $selected);

        $selectAttributes['id'] = $this->getIdAttribute($name, $selectAttributes);

        if (! isset($selectAttributes['name'])) {
            $selectAttributes['name'] = $name;
        }

        // We will simply loop through the options and build an HTML value for each of
        // them until we have an array of HTML declarations. Then we will join them
        // all together into one single HTML element that can be put on the form.
        $html = [];

        if (isset($selectAttributes['placeholder'])) {
            $html[] = $this->placeholderOption($selectAttributes['placeholder'], $selected);
            unset($selectAttributes['placeholder']);
        }

        foreach ($list as $value => $display) {
            $optionAttributes = $optionsAttributes[$value] ?? [];
            $optgroupAttributes = $optgroupsAttributes[$value] ?? [];
            $html[] = $this->getSelectOption($display, $value, $selected, $optionAttributes, $optgroupAttributes);
        }

        // Once we have all of this HTML, we can join this into a single element after
        // formatting the attributes into an HTML "attributes" string, then we will
        // build out a final select statement, which will contain all the values.
        $selectAttributes = $this->html->attributes($selectAttributes);

        $list = implode('', $html);

        return $this->toHtmlString("<select{$selectAttributes}>{$list}</select>");
    }