How to change the font in my custom CVS merge viewer? [message #437730] |
Wed, 09 June 2004 18:21 |
Mark Melvin Messages: 118 Registered: July 2009 |
Senior Member |
|
|
Hi Everyone,
I have created my own 'MergeViewer' (extending TextMergeViewer), so that
my source code is highlighted when I view it in the Team Synchronize
view. I did this by extending the extension point
"org.eclipse.compare.contentMergeViewers" for my particular file types.
Right now, my source viewer is dead simple with only partitioning and
syntax highlighting going on. All of the colors and stuff are
hard-coded as I have not implemented Preference Pages yet. This all
works great - I get colored source code in the CVS compare viewer - and
it really didn't take much effort (nice!).
The problem is - it is presented in a variable width font, and doesn't
seem to be affected by any of the preference settings in the Workbench >
Colors and Fonts preference settings. Not even the Text Compare
settings. My code to set up my viewer is simple and is as follows:
protected void configureTextViewer(TextViewer textViewer) {
if (textViewer instanceof SourceViewer) {
if (fSourceViewerConfiguration == null) {
fSourceViewerConfiguration = new MySourceViewerConfiguration(new
ColorManager());
}
((SourceViewer) textViewer).configure(getSourceViewerConfiguration());
}
}
I've tried setting the Font directly in the textViewer with something like:
textViewer.getTextWidget().setFont(new
Font(textViewer.getControl().getDisplay(), new FontData("Courier", 14,
SWT.NORMAL)));
But it seems to do nothing. Can anyone point me in the right direction
to set the font in my MergeViewer?
Thanks,
Mark.
|
|
|
Powered by
FUDForum. Page generated in 0.02050 seconds