8

Though I have looked at these two questions, fold sub blocks and manually fold code.

But it doesnt seems to work, because either the links are broken or some of the resources are unavailable.

In my project, I have lot of functions, which include literally millions of if/else statements. Now, whenever I have to look for a Log, I have to shuffle the entire code. Most of the time is wasted in the if/else code blocks. It would be really helpfull, if I could fold these if/else sub blocks. There is no inbuilt feature in eclipse though. Is there any plugin that could help for the purpose.

Community
  • 1
  • 1
Sahil Mahajan Mj
  • 11,033
  • 8
  • 53
  • 100
  • 1
    Just see this [Collapsing codes](http://stackoverflow.com/questions/1726525/is-there-a-way-to-collapse-all-code-blocks-in-eclipse). Also this [Doc](http://www.eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html) helps you – Murali Dec 22 '12 at 06:48
  • not exactly.:D but it seems like I'm traversing millions when I have to search for a log every 5 minutes. – Sahil Mahajan Mj Dec 22 '12 at 08:01
  • Possible duplicate of [Is there a way to fold eclipse sub-blocks like an "if" statement?](http://stackoverflow.com/questions/2369057/is-there-a-way-to-fold-eclipse-sub-blocks-like-an-if-statement) – CubeJockey Mar 14 '16 at 15:26

1 Answers1

0

Try this..

Preferences -> Java -> Editor -> Folding.

Set folding settings here by checking the boxes as your need..

Mohammed mansoor
  • 743
  • 3
  • 11
  • 18
  • 5
    I only see options for 1) Folding enabled, 2) which things are initially folded. Nothing to enable specific types of folding. Am I missing something? Thanks :) – WoodenKitty Oct 08 '14 at 03:28
  • 1
    Folding of if/else sub blocks for Java does not work in Eclipse, not even 7 years later, in 2019. There might be plugins that do that. – David Balažic Apr 17 '19 at 13:35