I am looking for a (clean) way to programmatically fold / expand methods (or a slightly lower level: line spacing) in a JDT editor in Eclipse.
I already read the documentation about the basic concept of folding (basic documents, projection documents), but the documentation has not helped me yet.
The alternative that I came across is the so-called SWTBot, which can be used to "emulate" a click on the "fold / unlold" button of the editor, but at present I find this an ugly hack.
Has anyone ever done something similar or had a key / example?
source share