Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Colorize code regions

Hi,

If I am not wrong the way to put Markers in the Eclipse's resources is
using some Nature or some Builder.

The problem is that I am trying to communicate Eclipse with an external
application which provides the mark data. I mean the "test.cpp, lien
30-40, color blue" is provided externally in any moment using some kind
of IPC implementation.

With this scenario, I am not sure how to find out the way to include
these marks in the Eclipse environment. Any idea?

Thanks & Regards
Xavi.
On Thu, 2010-07-01 at 08:54 -0500, Kennedy, Stephen M (Steve) wrote:
> In my plug-in, I've been using the org.eclipse.resource.markers, org.eclipse.ui.editors.annotationTypes and org.eclipse.ui.editor.markerAnnotationSpecification extension pts to do highlighting of ranges of code.  Basically I create a resource marker on the file and set the starting offset and ending offset attributes and eclipse takes care of highlighting the region.  However the user can change/override your choice of highlighting via Window->Preferences->General->Editors->Text Editors->Annotations.
> 
> I'm a bit fuzzy on the details, but I think I had to get the starting/ending offsets from the starting/ending lines from the Document correspoding to the editor input.
> 
> Steve
> 
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx 
> > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Xavier Pegenaute
> > Sent: Thursday, July 01, 2010 8:22 AM
> > To: cdt-dev@xxxxxxxxxxx
> > Subject: [cdt-dev] Colorize code regions
> > 
> > Hi,
> > 
> > I am thinking to develop a plugin. This plugin must mark some 
> > code region in the C/C++ editor. For example:
> > 
> > "test.cpp, line 30-40, color blue"
> > 
> > With this information I should be able to mark in the file "test.cpp"
> > the lines from 30-40 in blue (background). Is CDT able to 
> > support this?
> > is there some example?, documentation?, extension points to 
> > integrate it?




Back to the top