Index: src/org/eclipse/ui/texteditor/AbstractTextEditor.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java,v retrieving revision 1.138 diff -u -r1.138 AbstractTextEditor.java --- src/org/eclipse/ui/texteditor/AbstractTextEditor.java 23 Jun 2004 19:41:45 -0000 1.138 +++ src/org/eclipse/ui/texteditor/AbstractTextEditor.java 4 Jul 2004 06:40:21 -0000 @@ -1442,7 +1442,12 @@ * @since 3.0 */ public final static String PREFERENCE_WIDE_CARET= "AbstractTextEditor.Accessibility.WideCaret"; //$NON-NLS-1$ - + /** + * Key used to look up the force monospace preference. + * Value: {@value} + * @since 3.0 + */ + public final static String PREFERENCE_FORCE_MONOSPACE= "AbstractTextEditor.Accessibility.ForceMonospace"; //$NON-NLS-1$ /** Menu id for the editor context menu. */ public final static String DEFAULT_EDITOR_CONTEXT_MENU_ID= "#EditorContext"; //$NON-NLS-1$ @@ -2388,6 +2393,7 @@ initializeViewerColors(fSourceViewer); initializeFindScopeColor(fSourceViewer); initializeDragAndDrop(fSourceViewer); + initializeForceMonospace(fSourceViewer); StyledText styledText= fSourceViewer.getTextWidget(); @@ -3163,6 +3169,8 @@ updateCaret(); } else if (PREFERENCE_WIDE_CARET.equals(property)) { updateCaret(); + } else if (PREFERENCE_FORCE_MONOSPACE.equals(property)) { + initializeForceMonospace(fSourceViewer); } if (affectsTextPresentation(event)) @@ -5125,5 +5133,20 @@ */ public boolean isChangeInformationShowing() { return false; + } + + /** + * force monospace. + * + * @param viewer the viewer to be initialized + * + * @see org.eclipse.swt.graphics.TextLayout#forceMonospace(int, StyleItem) + */ + public void initializeForceMonospace (ISourceViewer viewer) { + IPreferenceStore store= getPreferenceStore(); + if (store != null) { + StyledText styledText= viewer.getTextWidget(); + styledText.setForceMonospace(store.getBoolean(PREFERENCE_FORCE_MONOSPACE)); + } } }