Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2019-07-27 18:34:37 +0000
committerAndrey Loskutov2019-07-30 18:40:22 +0000
commit9c6cbef8ec2954b57ab08f672742041eb615beb5 (patch)
treeb138e52d0413e5599d6817f2a4da0e124d776160 /org.eclipse.ui.editors
parentb98b09af8641e5048608225020caf0f7ce153e8e (diff)
downloadeclipse.platform.text-9c6cbef8ec2954b57ab08f672742041eb615beb5.tar.gz
eclipse.platform.text-9c6cbef8ec2954b57ab08f672742041eb615beb5.tar.xz
eclipse.platform.text-9c6cbef8ec2954b57ab08f672742041eb615beb5.zip
Bug 549604 - Text editor status line should show caret offset andY20190801-0900I20190801-1800I20190801-0600I20190731-1800I20190730-1800
selection The status line of the test editors before this change shows line:column information only. This change introduces additionally current cursor offset, or, if the editor has selection, count of selected characters. If the editor has no selection, line:column:caret offset is shown. If the editor has some selection, line:column[selected characters count] is shown. Both additions to the status line are enabled by default but can be turned off on the General -> Editors -> Test Editors preference page. Change-Id: I9e06f48f29987ac4eb21bfe0e818166bcbc61dbe Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r--org.eclipse.ui.editors/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.ui.editors/pom.xml2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java11
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java29
6 files changed, 45 insertions, 5 deletions
diff --git a/org.eclipse.ui.editors/META-INF/MANIFEST.MF b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
index efeb598c540..c3821be4c92 100644
--- a/org.eclipse.ui.editors/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ui.editors; singleton:=true
-Bundle-Version: 3.11.600.qualifier
+Bundle-Version: 3.12.0.qualifier
Bundle-Activator: org.eclipse.ui.internal.editors.text.EditorsPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
@@ -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.10.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.13.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/pom.xml b/org.eclipse.ui.editors/pom.xml
index fb389ea036f..0402e5b040c 100644
--- a/org.eclipse.ui.editors/pom.xml
+++ b/org.eclipse.ui.editors/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.editors</artifactId>
- <version>3.11.600-SNAPSHOT</version>
+ <version>3.12.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
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 751675a7507..fc766ccd06d 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
@@ -743,6 +743,9 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_CARET_OFFSET));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_SELECTION_SIZE));
+
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR));
@@ -885,6 +888,14 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements
Preference showLineNumbers= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, label, null);
addCheckBox(appearanceComposite, showLineNumbers, new BooleanDomain(), 0);
+ label= TextEditorMessages.TextEditorPreferencePage_showCaretOffsetInStatus;
+ Preference showCaretOffset= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_CARET_OFFSET, label, null);
+ addCheckBox(appearanceComposite, showCaretOffset, new BooleanDomain(), 0);
+
+ label= TextEditorMessages.TextEditorPreferencePage_showSelectionInStatus;
+ Preference showSelectionNumbers= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_SELECTION_SIZE, label, null);
+ addCheckBox(appearanceComposite, showSelectionNumbers, new BooleanDomain(), 0);
+
label= TextEditorMessages.TextEditorDefaultsPreferencePage_range_indicator;
Preference showMagnet= new Preference(AbstractDecoratedTextEditorPreferenceConstants.SHOW_RANGE_INDICATOR, label, null);
addCheckBox(appearanceComposite, showMagnet, 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 67f0ae97a67..12568d9e97c 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
@@ -40,6 +40,8 @@ final class TextEditorMessages extends NLS {
public static String TextEditorPreferencePage_printMarginColumn;
public static String TextEditorPreferencePage_printMarginAllowOverride;
public static String TextEditorPreferencePage_showLineNumbers;
+ public static String TextEditorPreferencePage_showCaretOffsetInStatus;
+ public static String TextEditorPreferencePage_showSelectionInStatus;
public static String TextEditorPreferencePage_highlightCurrentLine;
public static String TextEditorPreferencePage_showPrintMargin;
public static String TextEditorPreferencePage_color;
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 d3216b43412..a770961b5f6 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
@@ -22,6 +22,8 @@ TextEditorPreferencePage_undoHistorySize=&Undo history size:
TextEditorPreferencePage_printMarginColumn=Print margin colu&mn:
TextEditorPreferencePage_printMarginAllowOverride=Allow &editors to override the margin column
TextEditorPreferencePage_showLineNumbers=Show line num&bers
+TextEditorPreferencePage_showCaretOffsetInStatus=Show c&ursor position in the status line
+TextEditorPreferencePage_showSelectionInStatus=Show selection si&ze in the status line
TextEditorPreferencePage_highlightCurrentLine=Hi&ghlight current line
TextEditorPreferencePage_showPrintMargin=Sho&w print margin
TextEditorPreferencePage_color=&Color:
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 25f7c48640c..7f71c18e1e9 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
@@ -198,12 +198,34 @@ public class AbstractDecoratedTextEditorPreferenceConstants {
public final static String EDITOR_LINE_NUMBER_RULER= "lineNumberRuler"; //$NON-NLS-1$
/**
- * A named preference that holds the color used to render line numbers inside the line number ruler
- * (value <code>"lineNumberColor"</code>).
+ * A named preference that controls if the caret offset is shown in the status line.
+ * <p>
+ * The preference value is of type <code>Boolean</code>.
+ * </p>
+ *
+ * @since 3.12
+ */
+ public final static String EDITOR_SHOW_CARET_OFFSET= AbstractTextEditor.PREFERENCE_SHOW_CARET_OFFSET;
+
+ /**
+ * A named preference that controls if the selection size (number of selected characters) is
+ * shown in the status line.
+ * <p>
+ * The preference value is of type <code>Boolean</code>.
+ * </p>
+ *
+ * @since 3.12
+ */
+ public final static String EDITOR_SHOW_SELECTION_SIZE= AbstractTextEditor.PREFERENCE_SHOW_SELECTION_SIZE;
+
+ /**
+ * A named preference that holds the color used to render line numbers inside the line number
+ * ruler (value <code>"lineNumberColor"</code>).
* <p>
* The preference value is of type <code>String</code>. A RGB color value encoded as a string
* using class <code>PreferenceConverter</code>.
* </p>
+ *
* @see org.eclipse.jface.resource.StringConverter
* @see PreferenceConverter
* @see #EDITOR_LINE_NUMBER_RULER
@@ -693,6 +715,9 @@ public class AbstractDecoratedTextEditorPreferenceConstants {
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, false);
+ store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_CARET_OFFSET, true);
+ store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_SELECTION_SIZE, true);
+
if (!store.getBoolean(USE_QUICK_DIFF_PREFERENCE_PAGE)) {
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON, true);
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE, false);

Back to the top