Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to manually fold code in Eclipse?

Is there any way to manually create fold points in code in Eclipse? I know how to enable folding and how to set the auto preferences, but i like being able to set my own fold points so I can ignore certain parts of my code. Think regions in VS.
I know there is in VS and NetBeans, but I cannot find a way to set manual fold points in Eclipse.

like image 615
WolfmanDragon Avatar asked Oct 15 '08 19:10

WolfmanDragon


People also ask

Is there a way to collapse all code blocks in Eclipse?

There is a hotkey, mapped by default to Ctrl + Shift + NUM_KEYPAD_DIVIDE . You can change it to something else via Window -> Preferences, search for "Keys", then for "Collapse All". To open all code blocks the shortcut is Ctrl + Shift + NUM_KEYPAD_MULTIPLY .

How do you fold an Eclipse?

Eclipse supports code folding. Go to workbench preferences -> General -> Editors -> Structured Text Editors, and check the "Enable folding" box. Then go to workbench preferences -> Java -> Editor -> Folding, and adjust your folding preferences.

What do the preferences in Java editor folding control?

Code Folding enables you to 'collapse', or hide, certain sections of code while you are not working on them. This enables you to manage larger amounts of code within one window.

How do I get the code for Eclipse?

Use the menu Search->File and in the "Containing Text" field type in "System. out. println*", in the "File name patterns" field type in "*.


2 Answers

I don't think Eclipse has built in manual folding, but I did use a previous version of the following plugin for it.

Per the comment: The plugin has been recompiled for Eclipse 3.5 and is available at the Apache Isis site. A direct download link is also available. It also appears to work for Eclipse 3.6.

like image 108
Instantsoup Avatar answered Sep 18 '22 22:09

Instantsoup


The coffee bytes folding plug-in for eclipse is still alive. But the pages have moved.

An Overview and how to get it can be found here.

I've installed it in eclipse using the update page.

In Eclipse go to Help -> Install new Software
Enter: eclipse.realjenius.com/update-site
Select the plugin and follow on-screen instruction.

I'm still pretty new to eclipse development and had to install mylyn before installing the code folding plugin.

like image 24
oneofmany Avatar answered Sep 22 '22 22:09

oneofmany