This feature, where you only see the active code element you are editing is often confused with code folding. This feature is a standard Eclipse editor feature that can be toggled on or off using the preference at Window->Preferences->Java->Editor as shown below:
When the feature is turned on, you will only see the code element you are currently working on (e.g. the particular method you have your cursor in, or the selected method in the Outline view), when the feature is turned off, you will see the entire source file. The default is off, but sometimes folks will accidentally turn it on and, not surprisingly, be very frustrated to find that they can no longer see their whole file.
It is more likely to be accidentally turned on from a toolbar button. This toolbar button looks like this:
However, note that for eclipse luna (and MyEclipse 2015, based on luna) and, possibly, some earlier releases, this button may not be available (due to an eclipse problem with perspective customization).
This topic was modified 3 years, 8 months ago by support-tony. Reason: Typos and updates