Initializes the elevation of the preference screen.

@param sharedPreferences
The shared preferences, which should be used, as an instance of the type {@link
SharedPreferences}
778389
private void initializePreferenceScreenElevation(final SharedPreferences sharedPreferences) {
        String key = getString(R.string.preference_screen_elevation_preference_key);
        String defaultValue =
                getString(R.string.preference_screen_elevation_preference_default_value);
        int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue));
        setCardViewElevation(elevation);
    }
802444
private void setupSimplePreferencesScreen() {
        if (!isSimplePreferences(this)) {
            return;
        }

        // In the simplified UI, fragments are not used at all and we instead
        // use the older PreferenceActivity APIs.

        // Add 'general' preferences.
        addPreferencesFromResource(R.xml.pref_general);

        // Bind the summaries of EditText/List/Dialog/Ringtone preferences to
        // their values. When their values change, their summaries are updated
        // to reflect the new value, per the Android Design guidelines.
        bindPreferenceSummaryToValue(findPreference("server"));
        bindPreferenceSummaryToValue(findPreference("isCluster"));
        bindPreferenceSummaryToValue(findPreference("authToken"));
        bindPreferenceSummaryToValue(findPreference("appKey"));
        bindPreferenceSummaryToValue(findPreference("privateKey"));
        bindPreferenceSummaryToValue(findPreference("connMetada"));
        bindPreferenceSummaryToValue(findPreference("channel"));
        bindPreferenceSummaryToValue(findPreference("message"));
    }
225074
public void setProvisionedIops(java.util.Collection<Range> provisionedIops) {
        if (provisionedIops == null) {
            this.provisionedIops = null;
            return;
        }

        this.provisionedIops = new com.amazonaws.internal.SdkInternalList<Range>(provisionedIops);
    }
923465
@Override
    public boolean setPortletPreferences(List<IPortletPreference> portletPreferences) {
        if (portletPreferences == null) {
            final boolean modified = !this.portletPreferences.isEmpty();
            this.portletPreferences.clear();
            return modified;
        }

        final boolean modified = !this.portletPreferences.equals(portletPreferences);
        this.portletPreferences = portletPreferences;
        return modified;
    }
1173396
public static QuickAnalysisStrategy loadFromUserPreferences(final UserPreferences userPreferences) {
        final Map<String, String> properties = userPreferences.getAdditionalProperties();

        final int columnsPerAnalyzer =
                MapUtils.getIntValue(properties, USER_PREFERENCES_NAMESPACE + ".columnsPerAnalyzer", 5);
        final boolean includeValueDistribution =
                MapUtils.getBooleanValue(properties, USER_PREFERENCES_NAMESPACE + ".includeValueDistribution", false);
        final boolean includePatternFinder =
                MapUtils.getBooleanValue(properties, USER_PREFERENCES_NAMESPACE + ".includePatternFinder", false);

        return new QuickAnalysisStrategy(columnsPerAnalyzer, includeValueDistribution, includePatternFinder);
    }
592697
def set_default_preferences(self):
        

        LOGGER.debug("> Initializing default settings!")

        for key in self.__default_settings.allKeys():
            self.__settings.setValue(key, self.__default_settings.value(key))

        self.set_default_layouts()
        return True
1041753
private void initializeShowListDialogPreference() {
        Preference preference = findPreference(getString(R.string.show_list_dialog_preference_key));
        preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

            @Override
            public boolean onPreferenceClick(final Preference preference) {
                initializeListDialog();
                listDialog.setShowAnimation(createRectangularRevealAnimation(preference));
                listDialog.setDismissAnimation(createRectangularRevealAnimation(preference));
                listDialog.setCancelAnimation(createRectangularRevealAnimation(preference));
                listDialog.show();
                return true;
            }

        });
    }
564520
public void init(RecordOwner screen)
    {
        m_recDetail = null;
        m_recDetailChildren = null;
        m_recProjectTaskPredecessor = null;
        super.init(screen);
    }
1130234
private boolean shouldDividerTitleBeShown() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.show_divider_title_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.show_divider_title_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
63076
public void initPreferences(CmsWorkplaceManager wpManager) {

        CURRENT_DEFAULT_SETTINGS = this;
        Class<?> accessorClass = CmsUserSettingsStringPropertyWrapper.class;

        // first initialize all built-in preferences. these are:
        // a) Bean properties of CmsUserSettingsStringPropertyWrapper
        // b) Editor setting preferences
        // c) Gallery setting preferences
        PropertyDescriptor[] propDescs = PropertyUtils.getPropertyDescriptors(accessorClass);
        for (PropertyDescriptor descriptor : propDescs) {
            String name = descriptor.getName();
            Method getter = descriptor.getReadMethod();
            Method setter = descriptor.getWriteMethod();
            if ((getter == null) || (setter == null)) {
                continue;
            }

            PrefMetadata metadata = getter.getAnnotation(PrefMetadata.class);
            if (metadata == null) {
                CmsBuiltinPreference preference = new CmsBuiltinPreference(name);
                m_preferences.put(preference.getName(), preference);
            } else {
                try {
                    Constructor<?> constructor = metadata.type().getConstructor(String.class);
                    I_CmsPreference pref = (I_CmsPreference)constructor.newInstance(name);
                    m_preferences.put(pref.getName(), pref);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        }

        Map<String, String> editorValues = getEditorSettings();
        if (wpManager.getWorkplaceEditorManager() != null) {
            for (String resType : wpManager.getWorkplaceEditorManager().getConfigurableEditors().keySet()) {
                if (!editorValues.containsKey(resType)) {
                    editorValues.put(resType, null);
                }
            }
        }
        for (Map.Entry<String, String> editorSettingEntry : editorValues.entrySet()) {
            CmsEditorPreference pref = new CmsEditorPreference(
                editorSettingEntry.getKey(),
                editorSettingEntry.getValue());
            m_preferences.put(pref.getName(), pref);
        }

        Map<String, String> galleryValues = new HashMap<String, String>(getStartGalleriesSettings());
        for (String key : wpManager.getGalleries().keySet()) {
            if (!galleryValues.containsKey(key)) {
                galleryValues.put(key, null);
            }
        }
        for (Map.Entry<String, String> galleryEntry : galleryValues.entrySet()) {
            CmsStartGallleryPreference pref = new CmsStartGallleryPreference(
                galleryEntry.getKey(),
                galleryEntry.getValue());
            m_preferences.put(pref.getName(), pref);
        }

        // Now process configured preferences. Each configuration entry is either
        // for a built-in preference, in which case we create a wrapper around the existing preference,
        // or for a custom user-defined preference.
        for (CmsPreferenceData prefData : m_preferenceData) {
            String name = prefData.getName();
            I_CmsPreference pref = null;
            if (m_preferences.containsKey(name)) {
                // we first remove the existing preference, because in a LinkedHashMap, put(key, value) will not
                // update the position of the entry if the key already exists
                pref = new CmsWrapperPreference(prefData, m_preferences.remove(name));
            } else {
                pref = new CmsUserDefinedPreference(
                    prefData.getName(),
                    prefData.getDefaultValue(),
                    prefData.getPropertyDefinition(),
                    prefData.getTab());
            }
            m_preferences.put(pref.getName(), pref);
            pref.setValue(this, prefData.getDefaultValue());
        }
    }
1369437
@Initiate(priority = AutumnActionPriority.HIGH_PRIORITY)
    public void initiatePreferences() {
        for (final Entry<String, String> preference : preferencesToInitiate) {
            final String name = preference.key;
            final Preferences preferences = getPreferences(preference.value);
            namesToFiles.put(name, preferences);
            final Preference<?> preferenceWrapper = this.preferences.get(name);
            initiatePreference(name, preferenceWrapper, preferences);
            addLmlActions(name, preferenceWrapper);
        }
        preferencesToInitiate.clear();
    }
313323
private void readPreferences() {
    boolean runOnStartup = pref.getBoolean("runOnStartup", true);
    getRunOnStartupCheckBox().setSelected(runOnStartup);

    int maxCpus = pref.getInt("maxCpus", 0);
    if (maxCpus <= 0) {
      getLimitCpusCheckBox().setSelected(false);
      getMaxCpusTextField().setValue(Runtime.getRuntime().availableProcessors());
      getMaxCpusTextField().setEnabled(false);
    } else {
      getLimitCpusCheckBox().setSelected(true);
      getMaxCpusTextField().setValue(maxCpus);
      getMaxCpusTextField().setEnabled(true);
    }

    if (getRequireACCheckBox().isEnabled()) {
      boolean requireAC = pref.getBoolean("requireAC", false);
      int minBattLife = pref.getInt("minBattLife", 0);
      int minBattLifeWhileChg = pref.getInt("minBattLifeWhileChg", 0);
      getRequireACCheckBox().setSelected(requireAC);
      getMinBatteryLifeSlider().setEnabled(!requireAC);
      getMinBatteryLifeSlider().setValue(minBattLife);
      getMinBatteryLifeWhileChargingSlider().setValue(minBattLifeWhileChg);
    } else {
      getRequireACCheckBox().setSelected(false);
      getMinBatteryLifeSlider().setValue(0);
      getMinBatteryLifeWhileChargingSlider().setValue(0);
      getRequireACCheckBox().setEnabled(false);
      getMinBatteryLifeSlider().setEnabled(false);
      getMinBatteryLifeWhileChargingSlider().setEnabled(false);
    }

    boolean cacheClassDefinitions = pref.getBoolean("cacheClassDefinitions", true);
    getCacheClassDefinitionsCheckBox().setSelected(cacheClassDefinitions);
  }
1218475
private void initializeButtons() {
        setPositiveButton(android.R.string.ok, createRemovePreferenceHeaderClickListener());
        setNegativeButton(android.R.string.cancel, null);
    }
1278572
public void setDefaultUserSettings(CmsDefaultUserSettings defaultUserSettings) {

        m_defaultUserSettings = defaultUserSettings;

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_DEFAULT_USER_SETTINGS_1,
                    m_defaultUserSettings.getClass().getName()));
        }
    }
624408
public void setViewerPreferences(int preferences) {
		this.pageLayoutAndMode |= preferences;
		// for backwards compatibility, it is also possible
		// to set the following viewer preferences with this method:
		if ((preferences & viewerPreferencesMask) != 0) {
			pageLayoutAndMode = ~viewerPreferencesMask & pageLayoutAndMode;
			if ((preferences & PdfWriter.HideToolbar) != 0)
				viewerPreferences.put(PdfName.HIDETOOLBAR, PdfBoolean.PDFTRUE);
			if ((preferences & PdfWriter.HideMenubar) != 0)
				viewerPreferences.put(PdfName.HIDEMENUBAR, PdfBoolean.PDFTRUE);
			if ((preferences & PdfWriter.HideWindowUI) != 0)
				viewerPreferences.put(PdfName.HIDEWINDOWUI, PdfBoolean.PDFTRUE);
			if ((preferences & PdfWriter.FitWindow) != 0)
				viewerPreferences.put(PdfName.FITWINDOW, PdfBoolean.PDFTRUE);
			if ((preferences & PdfWriter.CenterWindow) != 0)
				viewerPreferences.put(PdfName.CENTERWINDOW, PdfBoolean.PDFTRUE);
			if ((preferences & PdfWriter.DisplayDocTitle) != 0)
				viewerPreferences.put(PdfName.DISPLAYDOCTITLE, PdfBoolean.PDFTRUE);
			
			if ((preferences & PdfWriter.NonFullScreenPageModeUseNone) != 0)
				viewerPreferences.put(PdfName.NONFULLSCREENPAGEMODE, PdfName.USENONE);
			else if ((preferences & PdfWriter.NonFullScreenPageModeUseOutlines) != 0)
				viewerPreferences.put(PdfName.NONFULLSCREENPAGEMODE, PdfName.USEOUTLINES);
			else if ((preferences & PdfWriter.NonFullScreenPageModeUseThumbs) != 0)
				viewerPreferences.put(PdfName.NONFULLSCREENPAGEMODE, PdfName.USETHUMBS);
			else if ((preferences & PdfWriter.NonFullScreenPageModeUseOC) != 0)
				viewerPreferences.put(PdfName.NONFULLSCREENPAGEMODE, PdfName.USEOC);

			if ((preferences & PdfWriter.DirectionL2R) != 0)
				viewerPreferences.put(PdfName.DIRECTION, PdfName.L2R);
			else if ((preferences & PdfWriter.DirectionR2L) != 0)
				viewerPreferences.put(PdfName.DIRECTION, PdfName.R2L);

			if ((preferences & PdfWriter.PrintScalingNone) != 0)
				viewerPreferences.put(PdfName.PRINTSCALING, PdfName.NONE);			
		}
	}
84385
function initPreferences(projectRootPath) {

        // Reject the old preferences if they have not completed.
        if (deferredPreferences && deferredPreferences.state() === "pending") {
            deferredPreferences.reject();
        }

        deferredPreferences = $.Deferred();
        var pr = ProjectManager.getProjectRoot();

        // Open preferences relative to the project root
        // Normally there is a project root, but for unit tests we need to
        // pass in a project root.
        if (pr) {
            projectRootPath = pr.fullPath;
        } else if (!projectRootPath) {
            console.log("initPreferences: projectRootPath has no value");
        }

        var path = projectRootPath + Preferences.FILE_NAME;

        FileSystem.resolve(path, function (err, file) {
            if (!err) {
                FileUtils.readAsText(file).done(function (text) {
                    var configObj = null;
                    try {
                        configObj = JSON.parse(text);
                    } catch (e) {
                        // continue with null configObj which will result in
                        // default settings.
                        console.log("Error parsing preference file: " + path);
                        if (e instanceof SyntaxError) {
                            console.log(e.message);
                        }
                    }
                    preferences = new Preferences(configObj);
                    deferredPreferences.resolve();
                }).fail(function (error) {
                    preferences = new Preferences();
                    deferredPreferences.resolve();
                });
            } else {
                preferences = new Preferences();
                deferredPreferences.resolve();
            }
        });
    }
432988
public void setPreferences(OperaPreferences newPreferences) {
    if (!(newPreferences instanceof OperaFilePreferences)) {
      OperaFilePreferences convertedPreferences = new OperaFilePreferences(preferenceFile);
      convertedPreferences.merge(newPreferences);
      preferences = convertedPreferences;
    } else {
      preferences = newPreferences;
    }
  }