From 10fedfa4d0a21faedffd597575938bc152a8df94 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 19 Jan 2007 11:16:09 +0000 Subject: [PATCH] Fix for Bug 170921 - Makefile editor does not respect tab width setting --- .../cdt/make/internal/ui/editor/MakefileEditor.java | 4 ++-- .../ui/editor/MakefileSourceConfiguration.java | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java index 135ab69314b..7885758e897 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2007 QNX Software Systems 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 @@ -103,7 +103,6 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor() */ protected void initializeEditor() { - setSourceViewerConfiguration(new MakefileSourceConfiguration(this)); setRangeIndicator(new DefaultRangeIndicator()); setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$ setRulerContextMenuId("#MakefileRulerContext"); //$NON-NLS-1$ @@ -113,6 +112,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe stores[1] = EditorsUI.getPreferenceStore(); ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(stores); setPreferenceStore(chainedStore); + setSourceViewerConfiguration(new MakefileSourceConfiguration(chainedStore, this)); } /* (non-Javadoc) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java index 3128873e6dd..d2ffcbd7be2 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2007 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.make.internal.ui.editor; @@ -18,6 +19,7 @@ import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner; import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileReconcilingStrategy; import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileTextHover; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.TextAttribute; @@ -35,8 +37,9 @@ import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.graphics.RGB; +import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; -public class MakefileSourceConfiguration extends SourceViewerConfiguration { +public class MakefileSourceConfiguration extends TextSourceViewerConfiguration { private ColorManager colorManager; MakefileCodeScanner codeScanner; @@ -54,8 +57,8 @@ public class MakefileSourceConfiguration extends SourceViewerConfiguration { /** * Constructor for MakeConfiguration */ - public MakefileSourceConfiguration(MakefileEditor editor) { - super(); + public MakefileSourceConfiguration(IPreferenceStore preferenceStore, MakefileEditor editor) { + super(preferenceStore); fEditor = editor; colorManager = ColorManager.getDefault(); }