Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keeping Code Collapsed - Eclipse IDE

Tags:

java

eclipse

Just curious if there's a setting somewhere in Eclipse to keep blocks of code collapsed when the class is opened? It's just I'll collapse methods then when the class is re-opened, everything is expanded.

Thanks

like image 398
Ash Avatar asked Nov 25 '11 07:11

Ash


People also ask

How do you collapse a line of code in Eclipse?

The Code Folding Preferences page is accessed from Window | Preferences | PHP | Editor | Code Folding . To configure your code folding preferences: Mark the Enable folding checkbox to enable code to be folded.

How do I fix indentations in Eclipse?

You can use Ctrl + A to select the entire file, then use this shortcut to quickly fix all the indentation. You can also change how Eclipse handles indentation by going to Window > Preferences, then in the left panel, navigate to Java > Code Style > Formatter > Edit... > Indentation.

What is code folding in IDE?

Go Up to The Code Editor Index (IDE Tutorial) Code Folding lets you collapse sections of code to create a hierarchical view of your code, making it easier to read and navigate. For guidance on creating Code Folding regions, see Using Code Folding.

Why is my code in Eclipse highlighted?

This is activated because of code coverage. If you want to remove it then follow these steps. Go to "Windows -> Show View -> Coverage" Select it. Click on "Open".


1 Answers

In Windows > preferences:

Java > editor > folding: check all, click apply & then OK.

Maybe this helps: Ctrl + Shift+ NUM_KEYPAD_DIVIDE collapse all methods in a java class.

Eclipse Source Code Folding

Source

like image 88
Yusuf K. Avatar answered Sep 25 '22 07:09

Yusuf K.