Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Programmatically folding of methods
Programmatically folding of methods [message #932779] Thu, 04 October 2012 12:20
Søren Skrædder is currently offline Søren SkrædderFriend
Messages: 1
Registered: October 2012
Junior Member

I'm desperately trying to programmatically collapse and expand methods in a JDT-Editor.

I read the documentation about the fundamental basics of folding, but I assume it's probably outdated. (

My first approach didn't work:
IJavaFoldingStructureProviderExtension extension = JavaPlugin.getDefault().getFoldingStructureProviderRegistry().getCurrentFoldingProvider();

ICompilationUnit c = ...; // c is actually a class
try {
    IJavaElement[] elements = c.getAllTypes()[0].getMethods();
} catch (JavaModelException e) {

While running the debugger, I found out that the "elements"-array contains all methods, so the call to collapse didn't work.

Has anyone ever done something similar or can give me any hints/examples?

Previous Topic:Migrating LTK/JDT related plugins from Eclipse 3.3 to 3.8
Next Topic:issue - print messages in eclipse console
Goto Forum:

Current Time: Mon Nov 23 16:48:31 GMT 2020

Powered by FUDForum. Page generated in 0.01846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top