Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to change the font in my custom CVS merge viewer?
How to change the font in my custom CVS merge viewer? [message #437730] Wed, 09 June 2004 18:21
Mark Melvin is currently offline Mark MelvinFriend
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.
Previous Topic:CheckboxCellEditor-Bug
Next Topic:Re: How to change the font in my custom CVS merge viewer?
Goto Forum:
  


Current Time: Fri Apr 19 01:09:38 GMT 2024

Powered by FUDForum. Page generated in 0.02050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top