Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] C Editor

Hi Igor,
 
the main classes to look at for the editor's highlighting and text presentation are
part of the JFace AbstractTextEditor's framework. The text presentation is
done by a variety of classes that implement the partitionning (splitting
source files into regions, e.g. code versus comments) and then
actual scanners for each region that highlight keywords etc.
 
Look in CSourceViewerConfiguration.java as a starting point (org.eclipse.cdt.internal.ui.text)
and follow from there -- CPartitionScanner, CCodeScanner etc. The mechanisms
for the preference changes is also relatively complicated, but eventually
filters back to an InvalidateTextPresentation() call in the CEditor (it
also requires that colors be abstracted from the styles returned by the
keyword scanners).
 
In any case, it will probably take you a few days to understand the framework, but once
you do, you'll see that it has a lot of features built in. As Thomas suggested, you may
also want to ask questions in the jface mailing list if we don't know the answer.
 
Sebastien
 
 
 -----Original Message-----
From: Igor S Zamjatin [mailto:isz@xxxxxxxxxxxxx]
Sent: Friday, September 13, 2002 9:43 AM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] C Editor


Hi, all!

I have a question about editor. I wrote my own editor and parser with it. My parser highlights text in the Editor. So I want to use color manager of C Editor. I mean color manager that situated in CEditorPreference Page in Windows->Preferences menu.

I found out how to get colors from manager after its changing(using storePreference) but I can't understand how to change text in my Editor after changind color in manager. I even can't understand how it works with C Editor. May be someone will prompt me how to do it. May be someone explain how it works with C Editor.

And also I don't understand mechanism of creating preview field in color manager. I found out that text for preview is loaded from special file but what happens then... This is my second question.

Help please!

Thanks in advance,

Igor S. Zamyatin(Garra)

Interstron Ltd
----------------------------------------
email:  isz@xxxxxxxxxxxxx
tel:    +7 (095) 269-4713
cell:   +7 (902) 659-5838
www:    http://www.interstron.ru

Back to the top