Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there an Eclipse shortcut to switch between multiple text editor configurations?

When using Eclipse, I typically have two editor tab configurations:

  1. Side-by-side configuration. I keep the main class file on the left and the corresponding unit tests on the right.
  2. Single-tab configuration. I view only one class file at a time in the editor.

I use #1 when at work, when my larger monitor allows me to see 100-column files side-by-side without horizontally scrolling.

I use #2 on my laptop when in transit (bus, plane, etc). My laptop is not wide enough to support side-by-side, so I only display one file at a time to avoid horizontally scrolling.

What I would really like is a way to switch configurations quickly. I often leave work with tons of tabs open in my workspace, which is very difficult to read when I open it on my laptop.

NOTE: Perspectives don't appear to solve this problem, since Editor configuration is constant across all perspectives.

share|improve this question
add comment

1 Answer

Your problem is that editors are not bound to perspectives like views are. Perspectives are collections of views, and optionally, a viewable editor area. However, which editor(s) are open at any time is something that's under the control of the workbench, and not the perspectives.

Nevertheless, a solution for your problem is discussed in the article
Show / Hide Eclipse RCP Editors depending on the current Perspective.

The article is too long to reproduce here, but the steps it describes are:

  1. Implement an Editors Tracker.
  2. Implement a Perspective Listener, which will listen for perspective changed events and will show or hide the editors accordingly.
  3. Subscribe the listener to the workbench.
share|improve this answer
    
Thanks for the comment. Seems like a lot of work. For now, I'm just closing all windows (ctrl+shift+w) when I start a laptop session and just open the Resources I care about manually. –  frankadelic Aug 6 '13 at 20:02
    
A lot of work because your demand wasn't foreseen for some unknown reason by the developers, so you have to extend the workbench yourself. –  harrymc Aug 7 '13 at 5:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.