DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Frameworks
  4. Eclipse Folding

Eclipse Folding

Erich Styger user avatar by
Erich Styger
·
Jul. 07, 12 · Interview
Like (0)
Save
Tweet
Share
14.67K Views

Join the DZone community and get the full member experience.

Join For Free

no, this is not about how to fold eclipse: it is about the folding feature of the eclipse editor view. my source files tend to get much larger than a single screen page. the eclipse framework comes with many great editor and navigation features, but it would be great to have the amount of information reduced. well, it can look like this:

source file with source folding

source file with source folding

yes, this shows about 140 lines of code in a condensed way :-) . it gives me the high level picture. i can dive into the details on demand. what i’m using here is the eclipse feature of folding . note the small + and - signs on the left side of the view: this is used to fold/unfold regions in the editor.

toggle folding

to toggle folding, i use the ctrl+numpad_divide command. i can use the command as well with ctrl+3 (see the mother of all eclipse shortcuts ):

folding commands

folding commands

note: in case numpad_divide is not easily accessible on my keyboard layout, the key bindings can be changed under the menu window > preferences > general > keys.

enabling folding

‘toggle folding’ just enables folding for the current editor view. by default it is not enabled when i open a new editor view. i can change and configure this. i go to the menu window > preferences and go the ‘folding’ setting page as below: here i can configure the level of folding:

folding preferences

folding preferences

i can fold/unfold portions in my source code like below which greatly improves readability:

folding markers

folding markers

to have a sneak preview what is inside a folded region, i do not need to unfold it: i simply move my mouse cursor over the + and a hover text will show what is behind it:

folding tool tip

folding tool tip

summary

folding makes it easy for me to navigate through big chunks of source files and to focus on the parts which are important. it saves me a lot of scrolling or navigating around.

happy folding and unfolding :-)

Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Tracking Software Architecture Decisions
  • 11 Observability Tools You Should Know
  • How We Solved an OOM Issue in TiDB with GOMEMLIMIT
  • Best CI/CD Tools for DevOps: A Review of the Top 10

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: