Obtains, whether the button, which allows to restore the preferences' default values, should
be shown, or not, from the activity's current theme.
482747
private void obtainShowRestoreDefaultsButton() {
        boolean show = ThemeUtil.getBoolean(getActivity(), R.attr.showRestoreDefaultsButton, false);
        showRestoreDefaultsButton(show);
    }
513575
private void setButtonTooltips() {
        if (frame.isIcon()) {

            if (restoreButtonToolTip != null && restoreButtonToolTip.length() != 0) {
                iconButton.setToolTipText(restoreButtonToolTip);
            }

            if (maxButtonToolTip != null && maxButtonToolTip.length() != 0) {
                maxButton.setToolTipText(maxButtonToolTip);
            }
        } else if (frame.isMaximum()) {

            if (iconButtonToolTip != null && iconButtonToolTip.length() != 0) {
                iconButton.setToolTipText(iconButtonToolTip);
            }

            if (restoreButtonToolTip != null && restoreButtonToolTip.length() != 0) {
                maxButton.setToolTipText(restoreButtonToolTip);
            }
        } else {

            if (iconButtonToolTip != null && iconButtonToolTip.length() != 0) {
                iconButton.setToolTipText(iconButtonToolTip);
            }

            if (maxButtonToolTip != null && maxButtonToolTip.length() != 0) {
                maxButton.setToolTipText(maxButtonToolTip);
            }
        }
    }
302080
private void adaptButtonBarVisibility() {
        if (buttonBar != null && buttonBarShadowView != null) {
            buttonBar.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE);
            buttonBarShadowView.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE);

            if (isButtonBarShown() && !isSplitScreen()) {
                adaptNavigationVisibility();
            }

            adaptNavigationEnabledState();
            adaptWizardButtonVisibilities();
        }
    }
258736
def default_preference_list(self, prefs):
        
        prefs = _check_preferences(prefs)
        if prefs is not None:
            self._prefs = prefs
749365
protected void updateVersionInPreferences() {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
        SharedPreferences.Editor editor = sp.edit();
        editor.putInt(VERSION_KEY, mCurrentVersionCode);

        // TODO: Update preferences from a background thread
        editor.commit();
    }
57565
private boolean shouldIconBeShown() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.show_bottom_sheet_icon_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.show_bottom_sheet_icon_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
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);
    }
1345047
private void setButtonBarVisible(boolean visible) {

        if (m_hasButtonBar != visible) {
            m_hasButtonBar = visible;
            if (m_hasButtonBar) {

                m_buttonBar.getStyle().clearDisplay();
                int width = CmsClientStringUtil.parseInt(m_borderTopStyle.getWidth()) + BUTTON_BAR_WIDTH;
                m_borderTopStyle.setWidth(width, Unit.PX);
                m_borderBottomStyle.setWidth(width, Unit.PX);
                m_borderRightStyle.setLeft(
                    CmsClientStringUtil.parseInt(m_borderRightStyle.getLeft()) + BUTTON_BAR_WIDTH,
                    Unit.PX);
            } else {
                m_buttonBar.getStyle().setDisplay(Display.NONE);
                int width = CmsClientStringUtil.parseInt(m_borderTopStyle.getWidth()) - BUTTON_BAR_WIDTH;
                m_borderTopStyle.setWidth(width, Unit.PX);
                m_borderBottomStyle.setWidth(width, Unit.PX);
                m_borderRightStyle.setLeft(
                    CmsClientStringUtil.parseInt(m_borderRightStyle.getLeft()) - BUTTON_BAR_WIDTH,
                    Unit.PX);
            }
        }
    }
1220585
private JButton getButtonAddActivities() {
        if (btnAddActivities == null) {
            btnAddActivities = new JButton();
            btnAddActivities.setAction(addActivitiesAction);
        }
        return btnAddActivities;
    }
279242
private OnClickListener createPreferenceButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final View v) {
                Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
                startActivity(intent);
            }

        };
    }
184628
private boolean shouldUseFullscreen() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.fullscreen_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.fullscreen_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
731880
public static boolean isButtonPressed(Button button) {

        if (button == null) {
            return false;
        }
        List<String> styles = Arrays.asList(button.getStyleName().split(" "));

        return styles.contains(OpenCmsTheme.BUTTON_PRESSED);
    }
1099521
def theme_get():
    
    from .theme_gray import theme_gray
    _theme = get_option('current_theme')
    if isinstance(_theme, type):
        _theme = _theme()
    return _theme or theme_gray()
982290
public void updateButtonVisibility() {
        if (isDirty()) {
            if (m_isValid) {
                m_saveButton.setEnabled(true);
            }
            m_undoButton.setEnabled(true);
            if (m_td != null) {
                m_td.setDirty(m_itemId, true);
            }
            m_owner.indicateDirtiness();
        } else {
            m_saveButton.setEnabled(false);
            m_undoButton.setEnabled(false);
            if (m_td != null) {
                m_td.setDirty(m_itemId, false);
            }
            m_owner.indicateDirtiness();
        }
        if (!m_isValid) {
            m_saveButton.setEnabled(false);
        }
    }
907620
private void setEnabledButtons() {
        int currentStep = getCurrentStep();
        if(currentStep < 0) {
           return;
        }
        
        boolean isPreviousEnabled = true;
        boolean isNextEnabled = true;
        
        if(getNextStep(currentStep) < 0 && currentStep != STEP_THANKS) {
            isNextEnabled = false;
        }

         if(getPreviousStep(currentStep) < 0) {
            isPreviousEnabled = false;
        }

        setIsControlEnable(previousButtonName, isPreviousEnabled);
        setIsControlEnable(nextButtonName, isNextEnabled);

        if(currentStep == STEP_OMISSIONS) {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_SUBMIT);
            if(theCommunityLogic.hasBadInterventions() || theCommunityLogic.hasOmissions()) {
                setIsControlEnable(nextButtonName, true);
            } else {
                 setIsControlEnable(nextButtonName, false);
            }
            
        } else if (currentStep == STEP_THANKS) {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_FINISH);
        } else {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_NEXT);
        }

    }
1298714
private void initializeShowEditTextDialogPreference() {
        Preference preference =
                findPreference(getString(R.string.show_edit_text_dialog_preference_key));
        preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

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

        });
    }
289729
private void previewButtonClicked() {
        if (!tagPreviewBtnClicked) {
            colorPickerLayout
                    .setSelectedColor(ColorPickerHelper.rgbToColorConverter(ColorPickerConstants.DEFAULT_COLOR));
        }

        tagPreviewBtnClicked = !tagPreviewBtnClicked;
        colorPickerLayout.setVisible(tagPreviewBtnClicked);
    }