[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Hiding certain portions of text

Hello,

I want to create an editor that can hide certain portions of text.
For example: I want to hide all comments in a C program.

printf("1");
// Hide Me A
printf("2");
// Hide Me B
printf("3");

I just want to hide the comments in the file without actually removing the comments in the underlying file.

I know it's possible since Eclipse Text Folding / Projection is able to hide/show portions of the document.

Browsing the APIs, I found about ITextViewer.setVisibleRegion(int start, int length). Is there a similar method that accepts an array of text regions?

If it's not supported by the Eclipse Text infrastructure, what is the best way to implement this?

Thanks,
Best regards.