diff options
author | Andrey Loskutov | 2014-08-05 17:09:27 +0000 |
---|---|---|
committer | Andrey Loskutov | 2015-11-10 08:33:11 +0000 |
commit | a50bb821beaaf193dc9bf412316a0c15b32ac0f1 (patch) | |
tree | ff0a54cea18b30bb67d13ea64a73dc4d57abd303 /org.eclipse.ui.editors | |
parent | b212745ce6ea0079e5876fe77658b174a124c1ae (diff) | |
download | eclipse.platform.text-a50bb821beaaf193dc9bf412316a0c15b32ac0f1.tar.gz eclipse.platform.text-a50bb821beaaf193dc9bf412316a0c15b32ac0f1.tar.xz eclipse.platform.text-a50bb821beaaf193dc9bf412316a0c15b32ac0f1.zip |
Bug 35779 - [misc] Text Viewer and Editor needs to support word wrap
Added "Enable word wrap when opening an editor" preference to "Text
Editors" preference page, "Toggle Word Wrap" text editor action /
toolbar button and ALT+SHIFT+Y shortcut for text editors extending
AbstractTextEditor.
Change-Id: Ibc4d64d0c76a31aff781726336d41b9ee1cbd659
Also-by: Florian Weßling <flo@cdhq.de>
Also-by: Holger Voormann <eclipse@voormann.de>
Also-by: Lars Vogel <Lars.Vogel@vogella.com>
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.ui.editors')
7 files changed, 22 insertions, 7 deletions
diff --git a/org.eclipse.ui.editors/META-INF/MANIFEST.MF b/org.eclipse.ui.editors/META-INF/MANIFEST.MF index 6dc39a9ed77..5e5a2e98bdc 100644 --- a/org.eclipse.ui.editors/META-INF/MANIFEST.MF +++ b/org.eclipse.ui.editors/META-INF/MANIFEST.MF @@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)", org.eclipse.ui;bundle-version="[3.5.0,4.0.0)", org.eclipse.jface.text;bundle-version="[3.8.0,4.0.0)", - org.eclipse.ui.workbench.texteditor;bundle-version="[3.7.0,4.0.0)", + org.eclipse.ui.workbench.texteditor;bundle-version="[3.10.0,4.0.0)", org.eclipse.core.filebuffers;visibility:=reexport;bundle-version="[3.5.0,4.0.0)", org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)", org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)" diff --git a/org.eclipse.ui.editors/plugin.properties b/org.eclipse.ui.editors/plugin.properties index ddb21a870db..ed4969788f6 100644 --- a/org.eclipse.ui.editors/plugin.properties +++ b/org.eclipse.ui.editors/plugin.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2014 IBM Corporation and others. +# Copyright (c) 2000, 2015 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ # Contributors: # IBM Corporation - initial API and implementation # Alex Weirig <alex.weirig@telewalfer.lu> - Collapse All (https://bugs.eclipse.org/bugs/show_bug.cgi?id=65268) +# Florian Weßling <flo@cdhq.de> - Adding (soft) word wrap (https://bugs.eclipse.org/bugs/show_bug.cgi?id=35779) ############################################################################### pluginName= Default Text Editor providerName= Eclipse.org @@ -123,6 +124,7 @@ preferenceKeywords.accessibility= accessibility caret cursor quick diff text edi preferenceKeywords.spelling= spelling spell checking dictionary correction check text editor preferenceKeywords.linkedmode= editor linked mode template preferenceKeywords.hyperlinkDetectors= hyperlinking text editor on demand link navigation modifier key +preferenceKeywords.wordWrap= word wrap wordwrap wrapping wordwrapping soft text line break linebreak #--- linked mode annotations linked.focus.label= Current range diff --git a/org.eclipse.ui.editors/plugin.xml b/org.eclipse.ui.editors/plugin.xml index 9d824937ff5..bea4d3b31fe 100644 --- a/org.eclipse.ui.editors/plugin.xml +++ b/org.eclipse.ui.editors/plugin.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> -<!-- ====================================================================== --> +<!-- ================================================================================================================= --> <!-- Copyright (c) 2002, 2015 IBM Corporation and others. --> <!-- All rights reserved. This program and the accompanying materials --> <!-- are made available under the terms of the Eclipse Public License v1.0 --> @@ -9,7 +9,8 @@ <!-- --> <!-- Contributors: --> <!-- IBM Corporation - initial API and implementation --> -<!-- ====================================================================== --> +<!-- Florian Weßling <flo@cdhq.de> - Adding (soft) word wrap (https://bugs.eclipse.org/bugs/show_bug.cgi?id=35779) --> +<!-- ================================================================================================================= --> <plugin> <extension-point id="documentProviders" name="%ExtPoint.documentProviders" schema="schema/documentProviders.exsd"/> @@ -224,6 +225,7 @@ <keywordReference id="org.eclipse.ui.editors.tabWidth"/> <keywordReference id="org.eclipse.ui.editors.lineNumber"/> <keywordReference id="org.eclipse.ui.editors.printMargin"/> + <keywordReference id="org.eclipse.ui.editors.wordWrap"/> </page> <page name="%PreferencePages.Annotations" @@ -301,6 +303,9 @@ <keyword label="%preferenceKeywords.hyperlinkDetectors" id="org.eclipse.ui.editors.hyperlinkDetectors"/> + <keyword + label="%preferenceKeywords.wordWrap" + id="org.eclipse.ui.editors.wordWrap"/> </extension> <extension point="org.eclipse.ui.editors.documentProviders"> diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java index 42e57c619af..85e569c9b79 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -681,6 +681,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH)); + overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractTextEditor.PREFERENCE_WORD_WRAP_ENABLED)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR)); @@ -805,6 +806,10 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements IntegerDomain tabWidthDomain= new IntegerDomain(1, 16); addTextField(appearanceComposite, tabWidth, tabWidthDomain, 15, 0); + label= TextEditorMessages.TextEditorPreferencePage_enableWordWrap; + Preference enableWordWrap= new Preference(AbstractTextEditor.PREFERENCE_WORD_WRAP_ENABLED, label, null); + addCheckBox(appearanceComposite, enableWordWrap, new BooleanDomain(), 0); + label= TextEditorMessages.TextEditorPreferencePage_convertTabsToSpaces; Preference spacesForTabs= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, label, null); addCheckBox(appearanceComposite, spacesForTabs, new BooleanDomain(), 0); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java index dcbf8c8cd7e..6d6044d45ef 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,6 +31,7 @@ final class TextEditorMessages extends NLS { public static String EditorsPlugin_internal_error; public static String LinkedModeConfigurationBlock_DASHED_BOX; public static String TextEditorPreferencePage_displayedTabWidth; + public static String TextEditorPreferencePage_enableWordWrap; public static String TextEditorPreferencePage_convertTabsToSpaces; public static String TextEditorPreferencePage_undoHistorySize; public static String TextEditorPreferencePage_printMarginColumn; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties index 0b2129623f2..053cf9fd2ef 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties @@ -13,6 +13,7 @@ EditorsPlugin_additionalInfo_affordance=Press 'Tab' from proposal table or click EditorsPlugin_internal_error=Internal Error TextEditorPreferencePage_displayedTabWidth=Displayed &tab width: +TextEditorPreferencePage_enableWordWrap=&Enable word wrap when opening an editor TextEditorPreferencePage_convertTabsToSpaces=&Insert spaces for tabs TextEditorPreferencePage_undoHistorySize=&Undo history size: TextEditorPreferencePage_printMarginColumn=Print margin colu&mn: diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java index 22a9a61e167..7bd29665ec3 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -745,6 +745,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { store.setDefault(EDITOR_TEXT_DRAG_AND_DROP_ENABLED, true); store.setDefault(EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true); store.setDefault(EDITOR_HOVER_ENRICH_MODE, 0); + store.setDefault(AbstractTextEditor.PREFERENCE_WORD_WRAP_ENABLED, false); MarkerAnnotationPreferences.initializeDefaultValues(store); |