/*
Settings related methods.
2197
@Override
    protected void createSharedPreferences() {
        super.createSharedPreferences();

        this.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

        // problem that the first call to getAll() returns nothing, apparently the
        // following two calls have to be made to read all the values correctly
        // http://stackoverflow.com/questions/9310479/how-to-iterate-through-all-keys-of-shared-preferences
        this.sharedPreferences.edit().clear();
        PreferenceManager.setDefaultValues(this, R.xml.preferences, true);

        this.sharedPreferences.registerOnSharedPreferenceChangeListener(this);
    }
152007
function Settings(types, settingValues) {
  this._types = types;

  // Where we store the settings that we've created
  this._settings = {};

  // Where the values for the settings are stored while in use.
  this._settingValues = settingValues || {};

  // Where the values for the settings are persisted for next use.
  this._settingStorage = new LocalSettingStorage();
  this._settingStorage.load(this._settingValues);

  // Event for use to detect when the list of settings changes
  this.onChange = util.createEvent('Settings.onChange');
}
575693
@JsonIgnore
	public Map<String, Object> getSettings() {
		if (settings == null) {
			settings = new LinkedHashMap<>();
		}
		return settings;
	}
733464
public function settingsSet($key, $value)
    {
        $allSettings = $this->settingsGetAll();
        $allSettings[$key] = $value;
        $this->settingsSetAll($allSettings);
    }
885915
public function apply_default_settings() {
        global $CFG;

        foreach ($this->forceable as $property) {

            if (isset($CFG->{"grade_$property"})) {

                if ($CFG->{"grade_$property"} == -1) {
                    continue; //temporary bc before version bump
                }
                $this->$property = $CFG->{"grade_$property"};
            }
        }
    }
815364
public void loadSettingValues() {
    PreferencesFxUtils.categoriesToSettings(flatCategoriesLst)
        .forEach(setting -> {
          LOGGER.trace("Loading: " + setting.getBreadcrumb());
          if (saveSettings) {
            setting.loadSettingValue(storageHandler);
          }
          history.attachChangeListener(setting);
        });
  }
67080
private function setSettings()
    {
        if (!empty($this->settings['url']) && is_string($this->settings['url'])) {
            $this->url = $this->settings['url'];
        } if (!empty($this->settings['version']) && is_string($this->settings['version'])) {
            $this->version = $this->settings['version'];
        } if (isset($this->settings['call']) && is_bool($this->settings['call'])) {
            $this->call = $this->settings['call'];
        } if (isset($this->settings['secured']) && is_bool($this->settings['secured'])) {
            $this->secure = $this->settings['secured'];
        }
        $this->changed = false;
    }
1052221
@Override
    public synchronized void initialize(Settings settings) {
        super.initialize(settings);
        setEnabled(checkEnabled());
        numberOfRetries = getSettings().getInt(Settings.KEYS.ANALYZER_CENTRAL_RETRY_COUNT, numberOfRetries);
    }
877655
function readINISettings()
    {
        $this->readImageHandlersFromINI();
        $this->readSupportedFormatsFromINI();
        $this->readImageAliasesFromINI();
        $this->readMIMETypeSettingsFromINI();
        $this->readMIMETypeQualitySettingFromINI();
        $this->readConversionRuleSettingsFromINI();
    }
866632
private void init() {
        if (provider != null) {
            propertyGrid.setTarget(StringUtils.isEmpty(groupId) ? null : new Settings(groupId, provider));
        }
    }
1357317
function(settings) {
        for (var k in settings) {
            if (settings.hasOwnProperty(k)) {
                this.param(k, settings[k]);
            }
        }
        return this;
    }
1139671
protected function resolveSettings()
    {
        $captured_settings = $this->string->captureDirectives('settings', ['singles' => true]);
        $combined_settings = $this->options->settings + $captured_settings;

        foreach ($combined_settings as &$value) {
            $this->placeVars($value);
        }

        $this->settings = new Settings($combined_settings);
    }
1029240
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    $value = $settings->{$key};
                }
            }
        }
    }
623977
private function setup_settings() {
		if ( defined( 'TECHNOTE_MOCK_REST_REQUEST' ) && TECHNOTE_MOCK_REST_REQUEST ) {
			$this->setting->remove_setting( 'use_admin_ajax' );
		}
		if ( $this->loader->api->is_empty() ) {
			$this->setting->remove_setting( 'use_admin_ajax' );
			$this->setting->remove_setting( 'get_nonce_check_referer' );
			$this->setting->remove_setting( 'check_referer_host' );
		}
		$key = $this->app->is_theme ? 'ThemeURI' : 'PluginURI';
		if ( ! empty( $this->_plugin_data[ $key ] ) && $this->utility->starts_with( $this->_plugin_data[ $key ], 'https://wordpress.org' ) ) {
			$this->setting->edit_setting( 'check_update', 'default', false );
		}
		if ( ! $this->log->is_valid() ) {
			$this->setting->remove_setting( 'save___log_term' );
			$this->setting->remove_setting( 'delete___log_interval' );
			$this->setting->remove_setting( 'capture_shutdown_error' );
		}
		if ( $this->get_config( 'config', 'prevent_use_log' ) ) {
			$this->setting->remove_setting( 'is_valid_log' );
		}
	}
723492
@Override
	protected void fillSettings(Settings settings)
	{
		super.fillSettings(settings);
		
		settings.setIntProperty("subscriberFailurePolicy", subscriberFailurePolicy);
		settings.setIntProperty("subscriberOverflowPolicy", subscriberOverflowPolicy);
		if (partitionsKeysToIndex != null)
			settings.setStringProperty("partitionsKeysToIndex", StringUtils.implode(partitionsKeysToIndex, ","));
	}
452777
private void applySettings() {
		linkContainer.reset();
		WLink exampleLink = new WLink();
		exampleLink.setText(tfLinkLabel.getText());
		final String url = tfUrlField.getValue();

		if ("".equals(url) || !isValidUrl(url)) {
			tfUrlField.setText(URL);
			exampleLink.setUrl(URL);
		} else {
			exampleLink.setUrl(url);
		}

		exampleLink.setRenderAsButton(cbRenderAsButton.isSelected());

		exampleLink.setText(tfLinkLabel.getText());

		if (cbSetImage.isSelected()) {
			WImage linkImage = new WImage("/image/attachment.png", "Add attachment");
			exampleLink.setImage(linkImage.getImage());
			exampleLink.setImagePosition((ImagePosition) ddImagePosition.getSelected());
		}

		exampleLink.setDisabled(cbDisabled.isSelected());

		if (tfAccesskey.getText() != null && tfAccesskey.getText().length() > 0) {
			exampleLink.setAccessKey(tfAccesskey.getText().toCharArray()[0]);
		}
		if (cbOpenNew.isSelected()) {
			exampleLink.setOpenNewWindow(true);
			exampleLink.setTargetWindowName("_blank");
		} else {
			exampleLink.setOpenNewWindow(false);
		}

		linkContainer.add(exampleLink);
	}
632759
function makeSettings() {
        var i;
        settings = $.extend({}, $.data(element, colorbox));
        
		for (i in settings) {
			if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
			    settings[i] = settings[i].call(element);
			}
		}
        
		settings.rel = settings.rel || element.rel || 'nofollow';
		settings.href = settings.href || $(element).attr('href');
		settings.title = settings.title || element.title;
        
        if (typeof settings.href === "string") {
            settings.href = $.trim(settings.href);
        }
	}