From 349efe6c0e0fa35d1b64c23ae351fb1b5c01cb74 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 26 Dec 2014 17:02:00 +0300 Subject: [PATCH] IDEA-134720 Reorganize UI for editor soft wraps settings - fixed exception --- .../ide/ui/EditorOptionsTopHitProvider.java | 14 +++++++++++++- .../src/messages/ApplicationBundle.properties | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/ui/EditorOptionsTopHitProvider.java b/platform/platform-impl/src/com/intellij/ide/ui/EditorOptionsTopHitProvider.java index f528bca961b3..e6c53ec7db6d 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/EditorOptionsTopHitProvider.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/EditorOptionsTopHitProvider.java @@ -16,6 +16,7 @@ package com.intellij.ide.ui; import com.intellij.ide.ui.search.BooleanOptionDescription; +import com.intellij.openapi.editor.ex.EditorSettingsExternalizable; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.SystemInfo; import com.intellij.util.containers.ContainerUtil; @@ -37,7 +38,18 @@ public class EditorOptionsTopHitProvider extends OptionsTopHitProvider { ? "checkbox.enable.ctrl.mousewheel.changes.font.size.macos" : "checkbox.enable.ctrl.mousewheel.changes.font.size"), "IS_WHEEL_FONTCHANGE_ENABLED"), editor("Mouse: " + messageApp("checkbox.enable.drag.n.drop.functionality.in.editor"), "IS_DND_ENABLED"), - editor("Virtual Space: " + messageApp("checkbox.show.all.softwraps"), "IS_ALL_SOFTWRAPS_SHOWN"), + new EditorOptionDescription(null, messageApp("checkbox.show.softwraps.only.for.caret.line.action.text"), "preferences.editor") { + @Override + public boolean isOptionEnabled() { + return !EditorSettingsExternalizable.getInstance().isAllSoftWrapsShown(); + } + + @Override + public void setOptionState(boolean enabled) { + EditorSettingsExternalizable.getInstance().setAllSoftwrapsShown(!enabled); + fireUpdated(); + } + }, editor("Virtual Space: " + messageApp("checkbox.allow.placement.of.caret.after.end.of.line"), "IS_VIRTUAL_SPACE"), editor("Virtual Space: " + messageApp("checkbox.allow.placement.of.caret.inside.tabs"), "IS_CARET_INSIDE_TABS"), editor("Virtual Space: " + messageApp("checkbox.show.virtual.space.at.file.bottom"), "ADDITIONAL_PAGE_AT_BOTTOM"), diff --git a/platform/platform-resources-en/src/messages/ApplicationBundle.properties b/platform/platform-resources-en/src/messages/ApplicationBundle.properties index 6a1baadbfc2f..29121a5e3a0c 100644 --- a/platform/platform-resources-en/src/messages/ApplicationBundle.properties +++ b/platform/platform-resources-en/src/messages/ApplicationBundle.properties @@ -390,7 +390,8 @@ group.soft.wraps=Soft Wraps checkbox.use.soft.wraps.at.editor=Use soft wraps in editor checkbox.use.soft.wraps.at.console=Use soft wraps in console checkbox.use.custom.soft.wraps.indent=Use original line's indent for wrapped parts. Additional shift: -checkbox.show.softwraps.only.for.caret.line=Show soft wrap symbols only for current line +checkbox.show.softwraps.only.for.caret.line=Show soft wraps for current line only +checkbox.show.softwraps.only.for.caret.line.action.text=Soft Wraps: Show for current line only group.virtual.space=Virtual Space checkbox.allow.placement.of.caret.after.end.of.line=Allow placement of caret after end of line checkbox.allow.placement.of.caret.inside.tabs=Allow placement of caret inside tabs