Java editor folding preferences only have the following: Comments, Header Comments, Inner Types, Members, Imports
However, I want to fold some arbitrary part of my code.
I tried enable folding of control flow statements (if/else) but seems it only applies to C/C++ editor and not Java.
I have found that within Eclipse itself this hasn't been addressed. Folding code with a free IDE often comes with its downsides and I believe this is one of those cases where you would have to switch over to a paid software to get that much flexibility. I tried to do this myself before coming to college and ended up learning that this IDE simply doesn't have the option to fold things you desire to fold. It has to be a block of code that is a loop, conditional, class, method, etc.