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());
}
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());
}
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();
}
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;
}
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;
}
Aggregations