[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] Colorize code regions
|
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?
>
> Thanks & Regards.
> Xavi.
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>