mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
Patch from Anton Leherbauer, Background color of templates, bug 105614.
This commit is contained in:
parent
4f434d0f92
commit
018ce2f78c
1 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2005 QNX Software Systems and others.
|
* Copyright (c) 2002, 2006 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Wind River Systems, Inc. - Bug fixes
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
@ -69,14 +70,15 @@ public class CTemplatePreferencePage extends TemplatePreferencePage {
|
||||||
* @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#createViewer(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#createViewer(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
protected SourceViewer createViewer(Composite parent) {
|
protected SourceViewer createViewer(Composite parent) {
|
||||||
SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
|
PreviewSourceViewer viewer= new PreviewSourceViewer(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
|
||||||
|
viewer.setPreferenceStore(CUIPlugin.getDefault().getCombinedPreferenceStore());
|
||||||
CTextTools tools= CUIPlugin.getDefault().getTextTools();
|
CTextTools tools= CUIPlugin.getDefault().getTextTools();
|
||||||
|
CSourceViewerConfiguration configuration = new CSourceViewerConfiguration(tools, null);
|
||||||
IDocument document = new Document();
|
IDocument document = new Document();
|
||||||
tools.setupCDocument(document);
|
tools.setupCDocument(document);
|
||||||
viewer.configure(new CSourceViewerConfiguration(tools, null));
|
viewer.configure(configuration);
|
||||||
viewer.setEditable(false);
|
viewer.setEditable(false);
|
||||||
viewer.setDocument(document);
|
viewer.setDocument(document);
|
||||||
viewer.getTextWidget().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
|
||||||
|
|
||||||
Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
|
Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
|
||||||
viewer.getTextWidget().setFont(font);
|
viewer.getTextWidget().setFont(font);
|
||||||
|
@ -91,6 +93,7 @@ public class CTemplatePreferencePage extends TemplatePreferencePage {
|
||||||
e.result = PreferencesMessages.getString("TemplatePreferencePage.preview"); //$NON-NLS-1$
|
e.result = PreferencesMessages.getString("TemplatePreferencePage.preview"); //$NON-NLS-1$
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
CSourcePreviewerUpdater.registerPreviewer(viewer, configuration, CUIPlugin.getDefault().getCombinedPreferenceStore());
|
||||||
return viewer;
|
return viewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue