Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 165264 Details for
Bug 309660
Caret not visible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
My first patch to implement the feature
patch.txt (text/plain), 19.22 KB, created by
Daoen Pan
on 2010-04-19 08:12:58 EDT
(
hide
)
Description:
My first patch to implement the feature
Filename:
MIME Type:
Creator:
Daoen Pan
Created:
2010-04-19 08:12:58 EDT
Size:
19.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.editors >Index: src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java,v >retrieving revision 1.47 >diff -u -r1.47 TextEditorDefaultsPreferencePage.java >--- src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java 18 Mar 2009 10:50:30 -0000 1.47 >+++ src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java 19 Apr 2010 12:04:16 -0000 >@@ -372,6 +372,7 @@ > private final String[][] fAppearanceColorListModel= new String[][] { > {TextEditorMessages.TextEditorPreferencePage_lineNumberForegroundColor, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, null}, > {TextEditorMessages.TextEditorPreferencePage_currentLineHighlighColor, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, null}, >+ {TextEditorMessages.TextEditorPreferencePage_cursorColor, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CUSTOM_CURSOR_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURSOR_SYSTEM_DEFAULT}, > {TextEditorMessages.TextEditorPreferencePage_printMarginColor, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, null}, > {TextEditorMessages.TextEditorPreferencePage_findScopeColor, AbstractTextEditor.PREFERENCE_COLOR_FIND_SCOPE, null}, > {TextEditorMessages.TextEditorPreferencePage_selectionForegroundColor, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR}, >@@ -451,7 +452,9 @@ > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TEXT_DRAG_AND_DROP_ENABLED)); > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE)); > overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HOVER_ENRICH_MODE)); >- >+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CUSTOM_CURSOR_COLOR)); >+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURSOR_SYSTEM_DEFAULT)); >+ > OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; > overlayKeys.toArray(keys); > return new OverlayPreferenceStore(getPreferenceStore(), keys); >Index: src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java,v >retrieving revision 1.33 >diff -u -r1.33 TextEditorMessages.java >--- src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java 23 Oct 2009 13:58:24 -0000 1.33 >+++ src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java 19 Apr 2010 12:04:16 -0000 >@@ -144,4 +144,5 @@ > public static String LinkedModeConfigurationBlock_labels_showIn; > public static String LinkedModeConfigurationBlock_color; > public static String LinkedModeConfigurationBlock_linking_title; >+ public static String TextEditorPreferencePage_cursorColor; > } >Index: src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties,v >retrieving revision 1.77 >diff -u -r1.77 TextEditorMessages.properties >--- src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties 23 Oct 2009 13:58:23 -0000 1.77 >+++ src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties 19 Apr 2010 12:04:17 -0000 >@@ -44,6 +44,7 @@ > > TextEditorPreferencePage_overwriteMode= Disable &overwrite typing mode > >+TextEditorPreferencePage_cursorColor= Cursor color > TextEditorPreferencePage_selectionForegroundColor= Selection foreground color > TextEditorPreferencePage_selectionBackgroundColor= Selection background color > TextEditorPreferencePage_systemDefault= System De&fault >Index: src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java,v >retrieving revision 1.143 >diff -u -r1.143 AbstractDecoratedTextEditor.java >--- src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java 17 Apr 2010 07:03:54 -0000 1.143 >+++ src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java 19 Apr 2010 12:04:17 -0000 >@@ -182,6 +182,14 @@ > */ > private final static String CURRENT_LINE_COLOR= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR; > /** >+ * Preference key for system default cursor. >+ */ >+ private final static String CURSOR_SYSTEM_DEFAULT = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURSOR_SYSTEM_DEFAULT; >+ /** >+ * Preference key for customized cursor color. >+ */ >+ private final static String CUSTOM_CURSOR_COLOR= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CUSTOM_CURSOR_COLOR; >+ /** > * Preference key for showing print margin ruler. > */ > private final static String PRINT_MARGIN= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN; >@@ -421,6 +429,7 @@ > support.setAnnotationPreference((AnnotationPreference) e.next()); > > support.setCursorLinePainterPreferenceKeys(CURRENT_LINE, CURRENT_LINE_COLOR); >+ support.setCursorColorPreferenceKeys(CURSOR_SYSTEM_DEFAULT, CUSTOM_CURSOR_COLOR); > support.setMarginPainterPreferenceKeys(PRINT_MARGIN, PRINT_MARGIN_COLOR, PRINT_MARGIN_COLUMN); > support.setSymbolicFontName(getFontPropertyPreferenceKey()); > } >Index: src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java,v >retrieving revision 1.57 >diff -u -r1.57 AbstractDecoratedTextEditorPreferenceConstants.java >--- src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java 18 Nov 2008 12:11:02 -0000 1.57 >+++ src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java 19 Apr 2010 12:04:18 -0000 >@@ -68,6 +68,27 @@ > public final static String EDITOR_CURRENT_LINE_COLOR= "currentLineColor"; //$NON-NLS-1$ > > /** >+ * A named preference that holds the custom color used for editor cursor. >+ * (value <code>"customCursorColor"</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 >+ */ >+ public final static String EDITOR_CUSTOM_CURSOR_COLOR= "customCursorColor"; //$NON-NLS-1$ >+ >+ /** >+ * A named preference that controls whether uses system default cursor. >+ * (value <code>"cursorColor.SystemDefault"</code>). >+ * <p> >+ * The preference value is of type <code>Boolean</code>. >+ * </p> >+ */ >+ public final static String EDITOR_CURSOR_SYSTEM_DEFAULT= "cursorColor.SystemDefault"; //$NON-NLS-1$ >+ >+ /** > * A named preference that holds the number of spaces used per tab in the text editor. > * <p> > * Value is of type <code>int</code>: positive int value specifying the number of >@@ -498,7 +519,8 @@ > store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_ANNOTATIONS_PREFERENCE_PAGE, false); > store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE, false); > >- store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true); >+ store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true); >+ store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURSOR_SYSTEM_DEFAULT, true); > > store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4); > store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, false); >#P org.eclipse.ui.workbench.texteditor >Index: src/org/eclipse/ui/internal/texteditor/MonoColorIBeamCursor.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/texteditor/MonoColorIBeamCursor.java >diff -N src/org/eclipse/ui/internal/texteditor/MonoColorIBeamCursor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/texteditor/MonoColorIBeamCursor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Daoen Pan <pan.daoen@consideo.com> >+ *******************************************************************************/ >+package org.eclipse.ui.internal.texteditor; >+ >+import org.eclipse.swt.graphics.Cursor; >+import org.eclipse.swt.graphics.ImageData; >+import org.eclipse.swt.graphics.PaletteData; >+import org.eclipse.swt.graphics.RGB; >+import org.eclipse.swt.widgets.Display; >+ >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * Helper class to create and dispose a mono-color I-Beam cursor with 16x16 dimension. >+ * >+ * The color of the cursor can be changed by the method <code>setRGB(RGB)</code>. The cursor is >+ * returned with the method <code>getCursor()</code>. >+ */ >+public class MonoColorIBeamCursor { >+ >+ private static byte[] ibeamShape= { (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, >+ (byte)0, (byte)0, (byte)0, (byte)1, (byte)1, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, (byte)0, >+ (byte)1, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)1, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)1, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)1, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)1, (byte)1, (byte)1, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)1, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)1, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)1, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)1, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)1, (byte)0, (byte)1, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)1, (byte)1, (byte)0, (byte)0, >+ (byte)0, (byte)1, (byte)1, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, >+ (byte)0, (byte)0, (byte)0, (byte)0, (byte)0 }; >+ >+ private Cursor cursor; >+ >+ /** >+ * Constructs an instance of MonoColorIBeamCursor with given color. >+ * >+ * @param rgb cursor color >+ */ >+ public MonoColorIBeamCursor(RGB rgb) { >+ createCursor(rgb); >+ } >+ >+ /** >+ * Dispose the cursor if necessary >+ */ >+ public void dispose() { >+ if (cursor != null) { >+ cursor.dispose(); >+ cursor= null; >+ } >+ } >+ >+ /** >+ * Return the colored I-Beam cursor or null. >+ * >+ * @return the cursor >+ */ >+ public Cursor getCursor() { >+ return cursor; >+ } >+ >+ /** >+ * Set the color of the I-Beam cursor >+ * >+ * @param rgb a new color >+ */ >+ public void setRGB(RGB rgb) { >+ dispose(); >+ if (rgb != null) >+ createCursor(rgb); >+ } >+ >+ /** >+ * Create a I-Beam cursor with given color >+ * >+ * @param rgb the cursor color >+ */ >+ private void createCursor(RGB rgb) { >+ Display display= PlatformUI.getWorkbench().getDisplay(); >+ if (display != null && !display.isDisposed()) { >+ RGB[] colors= { new RGB(0, 0, 0), new RGB(rgb.red, rgb.green, rgb.blue) }; >+ PaletteData palette= new PaletteData(colors); >+ ImageData cursorData= new ImageData(16, 16, 8, palette, 4, ibeamShape); >+ cursorData.transparentPixel= 0; >+ cursor= new Cursor(display, cursorData, 8, 8); >+ } >+ } >+} >Index: src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java,v >retrieving revision 1.22 >diff -u -r1.22 TextEditorPlugin.java >--- src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java 22 Oct 2008 11:05:00 -0000 1.22 >+++ src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java 19 Apr 2010 12:04:19 -0000 >@@ -16,6 +16,8 @@ > > import org.osgi.framework.BundleContext; > >+import org.eclipse.swt.graphics.Cursor; >+import org.eclipse.swt.graphics.RGB; > import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.IRegistryChangeEvent; > import org.eclipse.core.runtime.IRegistryChangeListener; >@@ -63,6 +65,11 @@ > private SpellingEngineRegistry fSpellingEngineRegistry; > > /** >+ * The shared I-Beam cursor for text based editors >+ */ >+ private MonoColorIBeamCursor sharedIBeamCursor; >+ >+ /** > * Creates a plug-in instance. > */ > public TextEditorPlugin() { >@@ -164,6 +171,10 @@ > Platform.getExtensionRegistry().removeRegistryChangeListener(this); > fQuickDiffExtensionRegistry= null; > fSpellingEngineRegistry= null; >+ if (sharedIBeamCursor != null) { >+ sharedIBeamCursor.dispose(); >+ sharedIBeamCursor= null; >+ } > super.stop(context); > } > >@@ -197,4 +208,20 @@ > public SpellingEngineRegistry getSpellingEngineRegistry() { > return fSpellingEngineRegistry; > } >+ >+ /** >+ * Return the I-Beam cursor with the given color. >+ * >+ * @param rgb the cursor color >+ * @return an I-Beam cursor >+ */ >+ public Cursor getSharedIBeamCursor(RGB rgb) { >+ if (rgb == null) >+ return null; >+ if (sharedIBeamCursor == null) >+ sharedIBeamCursor= new MonoColorIBeamCursor(rgb); >+ else >+ sharedIBeamCursor.setRGB(rgb); >+ return sharedIBeamCursor.getCursor(); >+ } > } >Index: src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java,v >retrieving revision 1.51 >diff -u -r1.51 SourceViewerDecorationSupport.java >--- src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java 19 Feb 2010 10:32:10 -0000 1.51 >+++ src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java 19 Apr 2010 12:04:19 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.StyledText; > import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.graphics.Cursor; > import org.eclipse.swt.graphics.GC; > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.RGB; >@@ -34,15 +35,16 @@ > import org.eclipse.jface.text.MarginPainter; > import org.eclipse.jface.text.source.Annotation; > import org.eclipse.jface.text.source.AnnotationPainter; >+import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy; >+import org.eclipse.jface.text.source.AnnotationPainter.ITextStyleStrategy; > import org.eclipse.jface.text.source.IAnnotationAccess; > import org.eclipse.jface.text.source.ICharacterPairMatcher; > import org.eclipse.jface.text.source.IOverviewRuler; > import org.eclipse.jface.text.source.ISharedTextColors; > import org.eclipse.jface.text.source.ISourceViewer; > import org.eclipse.jface.text.source.MatchingCharacterPainter; >-import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy; >-import org.eclipse.jface.text.source.AnnotationPainter.ITextStyleStrategy; > >+import org.eclipse.ui.internal.texteditor.TextEditorPlugin; > > > >@@ -229,6 +231,10 @@ > private String fCursorLinePainterEnableKey; > /** Preference key for the cursor line background color */ > private String fCursorLinePainterColorKey; >+ /** preference key for the enabling cursor color */ >+ private String fCursorColorDefaultKey; >+ /** preference key for the cursor color */ >+ private String fCursorColorKey; > /** Preference key for the margin painter */ > private String fMarginPainterEnableKey; > /** Preference key for the margin painter color */ >@@ -309,6 +315,8 @@ > showMargin(); > else > hideMargin(); >+ >+ updateCursorColor(); > > Iterator e= fAnnotationTypeKeyMap.keySet().iterator(); > while (e.hasNext()) { >@@ -445,6 +453,16 @@ > fCursorLinePainterEnableKey= enableKey; > fCursorLinePainterColorKey= colorKey; > } >+ >+ /** >+ * Sets the preference keys for the cursor color. >+ * @param defaultKey the preference key for the enabling cursor color >+ * @param colorKey the preference key for the cursor color >+ */ >+ public void setCursorColorPreferenceKeys(String defaultKey, String colorKey) { >+ fCursorColorDefaultKey= defaultKey; >+ fCursorColorKey= colorKey; >+ } > > /** > * Sets the preference keys for the margin painter. >@@ -526,6 +544,11 @@ > hideCursorLine(); > return; > } >+ >+ if (fCursorColorDefaultKey != null && fCursorColorKey != null) { >+ if (fCursorColorDefaultKey.equals(p) || fCursorColorKey.equals(p)) >+ updateCursorColor(); >+ } > > if (fCursorLinePainterColorKey != null && fCursorLinePainterColorKey.equals(p)) { > if (fCursorLinePainter != null) { >@@ -967,4 +990,18 @@ > fOverviewRuler.update(); > } > } >+ >+ /** >+ * Update the cursor color for the editor >+ */ >+ private void updateCursorColor() { >+ StyledText textWidget= fSourceViewer.getTextWidget(); >+ if (fPreferenceStore.getBoolean(fCursorColorDefaultKey)) { >+ textWidget.setCursor(null); >+ } else { >+ RGB rgb= PreferenceConverter.getColor(fPreferenceStore, fCursorColorKey); >+ Cursor cursor= TextEditorPlugin.getDefault().getSharedIBeamCursor(rgb); >+ textWidget.setCursor(cursor); >+ } >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 309660
: 165264 |
165270
|
165272
|
165479
|
165480
|
165481