Retrieves the selected values for the element. If the element isn't
present or a select, a null value will be returned.

@return String[]: the options from the select element
508313
@SuppressWarnings("squid:S1168")
    public String[] selectedValues() {
        if (isNotPresentSelect()) {
            return null;    // returning an empty array could be confused with no values selected
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        List<WebElement> options = dropdown.getAllSelectedOptions();
        String[] stringOptions = new String[options.size()];
        for (int i = 0; i < options.size(); i++) {
            stringOptions[i] = options.get(i).getAttribute(VALUE);
        }
        return stringOptions;
    }
306883
public function options()
    {
        if (!isset($this->_data['options']) || (isset($this->_data['options']) && empty($this->_data['options']))) {
            // No options provided
            return [];
        }
        if (!is_array($this->_data['options'])) {
            // An empty array?
            return [];
        }

        return ([ResourceTable::ALL_SELECT_VALUES_KEY => trans('resource-table::default.All')] + $this->_data['options']);
    }
480771
public function getBindValuesSELECT()
    {
        $bind_values = $this->bind_values;
        $i           = 1;
        foreach ($this->bind_where as $val) {
            $bind_values[$i] = $val;
            $i++;
        }
        foreach ($this->bind_having as $val) {
            $bind_values[$i] = $val;
            $i++;
        }
        return $bind_values;
    }
1060776
@Override
    public String[] getOptionValues() {
        String[] values = new String[valueOptions.size()];
        for (int i = 0; i < values.length; i++) {
            values[i] = valueOptions.get(i)[0];
        }
        return values;
    }
1256893
public function getOptions()
    {
        $options = [];
        foreach ($this->childNodes as $child) {
            if ($child instanceof Select\Option) {
                $options[] = $child;
            } else if ($child instanceof Select\Optgroup) {
                foreach ($child->getChildren() as $c) {
                    if ($c instanceof Select\Option) {
                        $options[] = $c;
                    }
                }
            }
        }
        return $options;
    }
352420
protected final function _getItems($select = null)
    {
        if (!$select) $select = $this->_getSelect();
        if (!$select) return array();

        return $this->getData()->parent->getComponent()->getItems($select);
    }
511639
protected function get_selected_options($returntexts = true) {

        $method = 'getHtml';
        if ($returntexts === false) {
            $method = 'getValue';
        }

        // Is the select multiple?
        $multiple = $this->field->hasAttribute('multiple');

        $selectedoptions = array(); // To accumulate found selected options.

        // Driver returns the values as an array or as a string depending
        // on whether multiple options are selected or not.
        $values = $this->field->getValue();
        if (!is_array($values)) {
            $values = array($values);
        }

        // Get all the options in the select and extract their value/text pairs.
        $alloptions = $this->field->findAll('xpath', '//option');
        foreach ($alloptions as $option) {
            // Is it selected?
            if (in_array($option->getValue(), $values)) {
                if ($multiple) {
                    // If the select is multiple, text commas must be encoded.
                    $selectedoptions[] = trim(str_replace(',', '\,', $option->{$method}()));
                } else {
                    $selectedoptions[] = trim($option->{$method}());
                }
            }
        }

        return implode(', ', $selectedoptions);
    }
981884
protected function getElementData()
    {
        $obDefaultCurrency = CurrencyHelper::instance()->getDefault();
        $sCurrencyCode = !empty($obDefaultCurrency) ? $obDefaultCurrency->code : null;

        $arResult = [
            'price_value'     => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->price_value,
            'old_price_value' => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->old_price_value,
            'trashed'         => $this->obElement->trashed(),
        ];

        return $arResult;
    }
922340
public function getPickerOptions()
    {
        return [
            'format'               => $this->getJavaScriptFormat(),
            'language'             => $this->getLocale(),
            'startView'            => $this->startView,
            'minView'              => $this->minView,
            'maxView'              => $this->maxView,
            'todayBtn'             => 'linked',
            'todayHighlight'       => true,
            'autoclose'            => true,
            'disableTouchKeyboard' => true,
            'ignoreReadonly'       => true,
        ];
    }
51557
public function getOptions()
    {
        // Create Options List:
        
        $options = ArrayList::create();
        
        // Iterate Source Items:
        
        foreach ($this->getSourceEmpty() as $value => $title) {
            $options->push($this->getFieldOption($value, $title));
        }
        
        // Handle Tags:
        
        if ($this->usesTags()) {
            
            // Obtain Source Values:
            
            $values = $this->getSourceValues();
            
            // Iterate Value Array:
            
            foreach ($this->getValueArray() as $value) {
                
                // Handle Tag Values:
                
                if (!in_array($value, $values)) {
                    $options->push($this->getFieldOption($value, $value));
                }
                
            }
            
        }
        
        // Apply Extensions:
        
        $this->extend('updateOptions', $options);
        
        // Answer Options List:
        
        return $options;
    }
849790
public function getSelectedOptions()
	{
		$ret = array();

		foreach ( $this->getOptions() as $option ) {
			if ( $option->isSelected() ) {
				$ret[] = $option;
			}
		}

		return $ret;
	}
1094052
protected function getOptions()
	{
		$options = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		// Initialize some field attributes.
		$filter = (string) $this->element['filter'];
		$exclude = (string) $this->element['exclude'];
		$hideNone = (string) $this->element['hide_none'];
		$hideDefault = (string) $this->element['hide_default'];

		// Get the path in which to search for file options.
		$path = (string) $this->element['directory'];

		if (!is_dir($path))
		{
			$path = JPATH_ROOT . '/' . $path;
		}

		// Prepend some default options based on field attributes.
		if (!$hideNone)
		{
			$text = $this->translateOptions
				? $this->getText()->alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: '- None Selected -';

			$options[] = $select->option('-1', $text);
		}

		if (!$hideDefault)
		{
			$text = $this->translateOptions
				? $this->getText()->alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: '- Use Default -';

			$options[] = $select->option('', $text);
		}

		// Get a list of folders in the search path with the given filter.
		$folders = Folder::folders($path, $filter);

		// Build the options list from the list of folders.
		if (is_array($folders))
		{
			foreach ($folders as $folder)
			{
				// Check to see if the file is in the exclude mask.
				if ($exclude)
				{
					if (preg_match(chr(1) . $exclude . chr(1), $folder))
					{
						continue;
					}
				}

				$options[] = $select->option($folder, $folder);
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
522661
public function getVarSelect()
    {
        if ($this->_sVarSelect === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
            $oArticle = $this->getArticle();
            $sVarSelectValue = $oArticle->oxarticles__oxvarselect->value;
            $this->_sVarSelect = (!empty($sVarSelectValue) || $sVarSelectValue === '0') ? $sVarSelectValue : '';
        }

        return $this->_sVarSelect;
    }
50741
protected function _getListOptionsForElem() {
		$cachePath = 'DefaultOptions_Form_' . $this->_currUIlang;
		$cached = Cache::read($cachePath, CAKE_THEME_CACHE_KEY_HELPERS);
		if (!empty($cached)) {
			return $cached;
		}

		$result = [];
		$result['select'] = [
			'extraOpt' => [
				'actions-box',
				'container',
				'count-selected-text',
				'deselect-all-text',
				'dropdown-align-right',
				'dropup-auto',
				'header',
				'hide-disabled',
				'icon-base',
				'live-search',
				'live-search-normalize',
				'live-search-placeholder',
				'live-search-style',
				'max-options',
				'max-options-text',
				'mobile',
				'multiple-separator',
				'none-selected-text',
				'select-all-text',
				'selected-text-format',
				'select-on-tab',
				'show-content',
				'show-icon',
				'show-subtext',
				'show-tick',
				'size',
				'style',
				'tick-icon',
				'width',
				'window-padding',
			]
		];
		$result['dateTime'] = [
			'defaultOpt' => [
				'label' => false,
				'data-toggle' => 'datetimepicker'
			],
			'extraOpt' => [
				'date-format',
				'date-locale',
				'icon-type',
				'widget-position-horizontal',
				'widget-position-vertical'
			]
		];
		$result['spin'] = [
			'defaultOpt' => [
				'data-toggle' => 'spin',
				'data-spin-verticalbuttons' => 'true',
				'label' => false,
			],
			'extraOpt' => [
				'min',
				'max',
				'step',
				'decimals',
				'maxboostedstep',
				'verticalbuttons',
				'prefix',
				'prefix_extraclass',
				'postfix',
				'postfix_extraclass',
			]
		];
		$result['flag'] = [
			'defaultOpt' => [
				'type' => 'select'
			],
			'extraOpt' => [
				'country-url',
			],
			'divOpt' => [
				'data-toggle' => 'flag-select',
				'data-button-type' => 'btn-default form-control',
			]
		];
		$result['autocomplete'] = [
			'defaultOpt' => [
				'data-toggle' => 'autocomplete',
				'label' => false,
			],
			'extraOpt' => [
				'type',
				'plugin',
				'url',
				'local',
				'min-length'
			]
		];
		$result['createUploadForm'] = [
			'type' => 'file',
			'default' => false,
			'url' => false
		];
		$result['upload'] = [
			'btnTitle' => $this->Html->tag('span', __d('view_extension', 'Select file...')),
			'inputOpt' => [
				'type' => 'file',
				'secure' => false,
				'label' => false,
				'div' => false,
				'data-toggle' => 'fileupload',
				'name' => 'files',
				'data-fileupload-btntext-upload' => __d('view_extension', 'Upload'),
				'data-fileupload-btntext-abort' => __d('view_extension', 'Abort'),
				'data-fileupload-msgtext-processing' => __d('view_extension', 'Processing...'),
				'data-fileupload-msgtext-error' => __d('view_extension', 'File upload failed'),
			]
		];
		$result['createFormTabs'] = [
			'tabListOpt' => [
				'class' => 'nav nav-pills nav-stacked col-xs-4 col-sm-4 col-md-4 col-lg-4'
			],
			'tabContentClass' => 'tab-content col-xs-8 col-lg-8 col-sm-8 col-md-8 col-lg-8',
			'submitBtn' => [
				'title' => __d('view_extension', 'Save'),
				'options' => [
					'class' => 'btn btn-success btn-md',
					'div' => 'form-group text-center'
				]
			]
		];
		Cache::write($cachePath, $result, CAKE_THEME_CACHE_KEY_HELPERS);

		return $result;
	}
828910
public function toOptionArray()
    {
        return array(
            array('value' => self::SELECT, 'label' => Mage::helper('adminhtml')->__('Select')),
            array('value' => self::TEXT, 'label' => Mage::helper('adminhtml')->__('Text')),
        );
    }
1191784
protected function getOptions()
	{
		// Initialize variables.
		$options = array();

		if (!self::$countries)
		{
			self::$countries = array();

			$countries = Geocode::countries();

			if ($countries && !empty($countries))
			{
				self::$countries = $countries;
			}
		}

		if ($this->element['option_blank'])
		{
			$options[] = Dropdown::option('', App::get('language')->txt('- Select -'), 'value', 'text');
		}

		foreach (self::$countries as $option)
		{
			// Create a new option object based on the <option /> element.
			$tmp = Dropdown::option(
				(string) $option->code,
				App::get('language')->alt(trim((string) $option->name), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text'
			);

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
192682
@SuppressWarnings("squid:S1168")
    public String[] selectOptions() {
        if (isNotPresentSelect()) {
            return null;    // returning an empty array could be confused with no options available
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        List<WebElement> options = dropdown.getOptions();
        String[] stringOptions = new String[options.size()];
        for (int i = 0; i < options.size(); i++) {
            stringOptions[i] = options.get(i).getText();
        }
        return stringOptions;
    }