Search in sources :

Example 1 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ConsoleConfigurable method apply.

@Override
public void apply() throws ConfigurationException {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    UISettings uiSettings = UISettings.getInstance();
    editorSettings.setUseSoftWraps(myCbUseSoftWrapsAtConsole.isSelected(), SoftWrapAppliancePlaces.CONSOLE);
    boolean uiSettingsChanged = false;
    if (isModified(myCommandsHistoryLimitField, uiSettings.getConsoleCommandHistoryLimit())) {
        uiSettings.setConsoleCommandHistoryLimit(Math.max(0, Math.min(1000, Integer.parseInt(myCommandsHistoryLimitField.getText().trim()))));
        uiSettingsChanged = true;
    }
    if (ConsoleBuffer.useCycleBuffer()) {
        if (isModified(myCbOverrideConsoleCycleBufferSize, uiSettings.getOverrideConsoleCycleBufferSize())) {
            uiSettings.setOverrideConsoleCycleBufferSize(myCbOverrideConsoleCycleBufferSize.isSelected());
            uiSettingsChanged = true;
        }
        if (isModified(myConsoleCycleBufferSizeField, uiSettings.getConsoleCycleBufferSizeKb())) {
            uiSettings.setConsoleCycleBufferSizeKb(Math.max(0, Math.min(1024 * 100, Integer.parseInt(myConsoleCycleBufferSizeField.getText().trim()))));
            uiSettingsChanged = true;
        }
    }
    if (uiSettingsChanged) {
        uiSettings.fireUISettingsChanged();
    }
    myNegativePanel.applyTo(mySettings.getNegativePatterns());
    myPositivePanel.applyTo(mySettings.getPositivePatterns());
}
Also used : UISettings(com.intellij.ide.ui.UISettings) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 2 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ConsoleConfigurable method reset.

@Override
public void reset() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    UISettings uiSettings = UISettings.getInstance();
    myCbUseSoftWrapsAtConsole.setSelected(editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.CONSOLE));
    myCommandsHistoryLimitField.setText(Integer.toString(uiSettings.getConsoleCommandHistoryLimit()));
    myCbOverrideConsoleCycleBufferSize.setEnabled(ConsoleBuffer.useCycleBuffer());
    myCbOverrideConsoleCycleBufferSize.setSelected(uiSettings.getOverrideConsoleCycleBufferSize());
    myConsoleCycleBufferSizeField.setEnabled(ConsoleBuffer.useCycleBuffer() && uiSettings.getOverrideConsoleCycleBufferSize());
    myConsoleCycleBufferSizeField.setText(Integer.toString(uiSettings.getConsoleCycleBufferSizeKb()));
    myNegativePanel.resetFrom(mySettings.getNegativePatterns());
    myPositivePanel.resetFrom(mySettings.getPositivePatterns());
}
Also used : UISettings(com.intellij.ide.ui.UISettings) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 3 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class EditorAppearanceConfigurable method apply.

@Override
public void apply() throws ConfigurationException {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    editorSettings.setBlinkCaret(myCbBlinkCaret.isSelected());
    try {
        editorSettings.setBlinkPeriod(Integer.parseInt(myBlinkIntervalField.getText()));
    } catch (NumberFormatException ignore) {
    }
    editorSettings.setBlockCursor(myCbBlockCursor.isSelected());
    editorSettings.setRightMarginShown(myCbRightMargin.isSelected());
    editorSettings.setLineNumbersShown(myCbShowLineNumbers.isSelected());
    editorSettings.setWhitespacesShown(myCbShowWhitespaces.isSelected());
    editorSettings.setLeadingWhitespacesShown(myLeadingWhitespacesCheckBox.isSelected());
    editorSettings.setInnerWhitespacesShown(myInnerWhitespacesCheckBox.isSelected());
    editorSettings.setTrailingWhitespacesShown(myTrailingWhitespacesCheckBox.isSelected());
    editorSettings.setIndentGuidesShown(myShowVerticalIndentGuidesCheckBox.isSelected());
    EditorOptionsPanel.reinitAllEditors();
    DaemonCodeAnalyzerSettings.getInstance().SHOW_METHOD_SEPARATORS = myCbShowMethodSeparators.isSelected();
    UISettings uiSettings = UISettings.getInstance();
    boolean uiSettingsModified = false;
    boolean lafSettingsModified = false;
    if (uiSettings.getShowEditorToolTip() != myShowCodeLensInEditorCheckBox.isSelected()) {
        uiSettings.setShowToolWindowsNumbers(myShowCodeLensInEditorCheckBox.isSelected());
        uiSettingsModified = true;
        lafSettingsModified = true;
    }
    if (editorSettings.isBreadcrumbsShown() != myShowBreadcrumbsCheckBox.isSelected()) {
        editorSettings.setBreadcrumbsShown(myShowBreadcrumbsCheckBox.isSelected());
        uiSettingsModified = true;
    }
    if (lafSettingsModified) {
        LafManager.getInstance().repaintUI();
    }
    if (uiSettingsModified) {
        uiSettings.fireUISettingsChanged();
    }
    EditorOptionsPanel.restartDaemons();
    applyNameHintsSettings();
    super.apply();
}
Also used : UISettings(com.intellij.ide.ui.UISettings) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 4 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class EditorOptionsPanel method isModified.

@Override
public boolean isModified() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    UISettings uiSettings = UISettings.getInstance();
    VcsApplicationSettings vcsSettings = VcsApplicationSettings.getInstance();
    // Display
    boolean isModified = isModified(myCbSmoothScrolling, editorSettings.isSmoothScrolling());
    // Brace highlighting
    isModified |= isModified(myCbHighlightBraces, codeInsightSettings.HIGHLIGHT_BRACES);
    isModified |= isModified(myCbHighlightScope, codeInsightSettings.HIGHLIGHT_SCOPE);
    isModified |= isModified(myCbHighlightIdentifierUnderCaret, codeInsightSettings.HIGHLIGHT_IDENTIFIER_UNDER_CARET);
    // Virtual space
    isModified |= isModified(myCbUseSoftWrapsAtEditor, editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.MAIN_EDITOR));
    isModified |= isModified(myCbUseCustomSoftWrapIndent, editorSettings.isUseCustomSoftWrapIndent());
    isModified |= editorSettings.getCustomSoftWrapIndent() != getCustomSoftWrapIndent();
    isModified |= isModified(myCbShowSoftWrapsOnlyOnCaretLine, !editorSettings.isAllSoftWrapsShown());
    isModified |= isModified(myCbVirtualSpace, editorSettings.isVirtualSpace());
    isModified |= isModified(myCbCaretInsideTabs, editorSettings.isCaretInsideTabs());
    isModified |= isModified(myCbVirtualPageAtBottom, editorSettings.isAdditionalPageAtBottom());
    // Limits
    isModified |= getMaxClipboardContents() != uiSettings.getMaxClipboardContents();
    // Paste
    // Strip trailing spaces, ensure EOL on EOF on save
    isModified |= !getStripTrailingSpacesValue().equals(editorSettings.getStripTrailingSpaces());
    isModified |= isModified(myCbKeepTrailingSpacesOnCaretLine, editorSettings.isKeepTrailingSpacesOnCaretLine());
    isModified |= isModified(myCbEnsureBlankLineBeforeCheckBox, editorSettings.isEnsureNewLineAtEOF());
    isModified |= isModified(myCbShowQuickDocOnMouseMove, editorSettings.isShowQuickDocOnMouseOverElement());
    isModified |= isModified(myQuickDocDelayTextField, editorSettings.getQuickDocOnMouseOverElementDelayMillis(), EditorSettingsExternalizable.QUICK_DOC_DELAY_RANGE);
    // advanced mouse
    isModified |= isModified(myCbEnableDnD, editorSettings.isDndEnabled());
    isModified |= isModified(myCbEnableWheelFontChange, editorSettings.isWheelFontChangeEnabled());
    isModified |= isModified(myCbHonorCamelHumpsWhenSelectingByClicking, editorSettings.isMouseClickSelectionHonorsCamelWords());
    isModified |= isModified(myRbPreferMovingCaret, editorSettings.isRefrainFromScrolling());
    isModified |= isModified(myRecentFilesLimitField, UISettings.getInstance().getRecentFilesLimit(), RECENT_FILES_RANGE);
    isModified |= isModified(myCbRenameLocalVariablesInplace, editorSettings.isVariableInplaceRenameEnabled());
    isModified |= isModified(myPreselectCheckBox, editorSettings.isPreselectRename());
    isModified |= isModified(myShowInlineDialogForCheckBox, editorSettings.isShowInlineLocalDialog());
    isModified |= isModified(myShowNotificationAfterReformatCodeCheckBox, editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_REFORMAT_CODE_ACTION);
    isModified |= isModified(myShowNotificationAfterOptimizeImportsCheckBox, editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_OPTIMIZE_IMPORTS_ACTION);
    isModified |= isModified(myShowLSTInGutterCheckBox, vcsSettings.SHOW_LST_GUTTER_MARKERS);
    isModified |= isModified(myShowWhitespacesModificationsInLSTGutterCheckBox, vcsSettings.SHOW_WHITESPACES_IN_LST);
    isModified |= myErrorHighlightingPanel.isModified();
    RichCopySettings settings = RichCopySettings.getInstance();
    isModified |= isModified(myCbEnableRichCopyByDefault, settings.isEnabled());
    isModified |= !Comparing.equal(settings.getSchemeName(), myRichCopyColorSchemeComboBox.getSelectedItem());
    return isModified;
}
Also used : CodeInsightSettings(com.intellij.codeInsight.CodeInsightSettings) RichCopySettings(com.intellij.openapi.editor.richcopy.settings.RichCopySettings) UISettings(com.intellij.ide.ui.UISettings) VcsApplicationSettings(com.intellij.openapi.vcs.VcsApplicationSettings) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 5 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class EditorTabsConfigurable method isModified.

@Override
public boolean isModified() {
    final UISettings uiSettings = UISettings.getInstance();
    boolean isModified = isModified(myCbModifiedTabsMarkedWithAsterisk, uiSettings.getMarkModifiedTabsWithAsterisk());
    isModified |= isModified(myShowTabsTooltipsCheckBox, uiSettings.getShowTabsTooltips());
    isModified |= isModified(myEditorTabLimitField, uiSettings.getEditorTabLimit());
    isModified |= isModified(myReuseNotModifiedTabsCheckBox, uiSettings.getReuseNotModifiedTabs());
    int tabPlacement = ((Integer) myEditorTabPlacement.getSelectedItem()).intValue();
    isModified |= tabPlacement != uiSettings.getEditorTabPlacement();
    isModified |= myHideKnownExtensions.isSelected() != uiSettings.getHdeKnownExtensionInTabs();
    isModified |= myShowDirectoryInTabCheckBox.isSelected() != uiSettings.getShowDirectoryForNonUniqueFilenames();
    isModified |= myScrollTabLayoutInEditorCheckBox.isSelected() != uiSettings.getScrollTabLayoutInEditor();
    isModified |= myHideTabsCheckbox.isSelected() != uiSettings.getHideTabsIfNeed();
    isModified |= myShowCloseButtonOnCheckBox.isSelected() != uiSettings.getShowCloseButton();
    isModified |= isModified(myCloseNonModifiedFilesFirstRadio, uiSettings.getCloseNonModifiedFilesFirst());
    isModified |= isModified(myActivateMRUEditorOnCloseRadio, uiSettings.getActiveMruEditorOnClose());
    isModified |= isModified(myActivateRightNeighbouringTabRadioButton, uiSettings.getActiveRigtEditorOnClose());
    return isModified;
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Aggregations

UISettings (com.intellij.ide.ui.UISettings)38 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)8 Project (com.intellij.openapi.project.Project)4 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)3 RichCopySettings (com.intellij.openapi.editor.richcopy.settings.RichCopySettings)3 VcsApplicationSettings (com.intellij.openapi.vcs.VcsApplicationSettings)3 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 HyperlinkEvent (javax.swing.event.HyperlinkEvent)2 DaemonCodeAnalyzerSettings (com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings)1 QuickDocOnMouseOverManager (com.intellij.codeInsight.documentation.QuickDocOnMouseOverManager)1 ColorBlindness (com.intellij.ide.ui.ColorBlindness)1 UISettingsListener (com.intellij.ide.ui.UISettingsListener)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 Notification (com.intellij.notification.Notification)1 NotificationListener (com.intellij.notification.NotificationListener)1 Application (com.intellij.openapi.application.Application)1 ApplicationManager.getApplication (com.intellij.openapi.application.ApplicationManager.getApplication)1