42

Eclipse Juno - In my workspace I have 'Package Explorer' opened on the left side, on the right side I have 6 visible file tabs and under 'Show List' I have 17 files.

Out of those 6 visible file tabs, I'm working on the 3rd file (abc.java) and If I pick up a file under 'Show List' (xyz.java), then eclipse displays xyz.java as active tab and the next 5 files from the Show List. My previous visible file tabs are gone and now I have a new set of visible file tabs. Is there a way to have my previous active file 'abc.java' under visible file tabs with my current active file as 'xyz.java'

4
  • 8
    This drives me crazy, so I just filed a bug about it: bugs.eclipse.org/bugs/show_bug.cgi?id=389169
    – jfritz42
    Sep 10, 2012 at 15:11
  • 2
    I'm with jfritz...this new behavior bugs the heck out of me. Thanks for filing the report.
    – Grekker
    Oct 2, 2012 at 4:21
  • As I read the discussion on the bug, the more I read the more I sense "We've made the tabs useless on purpose, to force people to use cool features like theme managers they never used before because things were simply working for them."
    – SF.
    Jul 24, 2015 at 12:30
  • Duplicate of stackoverflow.com/questions/12578197/… Nov 26, 2015 at 7:50

4 Answers 4

35

I think I just had the same problem and I solved it by switching the theme.

Go to Preferences -> General -> Appearance and switch to the Classic theme.

I can't understand why this helps, but it worked for me.

Update:

After being bitten by this again I checked again and as @anweibel says in his answer this can be edited in the CSS.

I just installed the E4 CSS editor plugin using the Eclipse Marketplace so that I could change the CSS directly from Eclipse under Preferences -> Apperance. I changed swt-mru-visible from false to true so that the relevant part for the GTK theme looked like this:

.MPartStack {
    font-size: 11;
    swt-simple: false;
    swt-mru-visible: true;
}

A restart was required for the changes to take effect.

More info can also be found here: Eclipse tabs repositionning

4
  • 1
    Thanks @oyse. I tested and it worked. Noticed 'Windows7 Classic' theme also works.
    – SyAu
    Jul 3, 2012 at 0:17
  • 1
    I really don't get the new Juno behaviour here, it seems utterly stupid to me (and the fact that to change that behaviour you have to change the "theme"... well...)
    – leonbloy
    Sep 9, 2012 at 17:24
  • This workaround doesn't work for me :( I'm editing C++, BTW, not Java. I wonder if that makes a difference.
    – jfritz42
    Sep 10, 2012 at 15:22
  • Correction to my last comment: the workaround does work for me. I had to restart Eclipse for it to take effect.
    – jfritz42
    Oct 5, 2012 at 15:21
27

There's a more straight-forward way to bring back the old tab behavior of the eclipse Juno editor:

  • Go to INSTALL/plugins/org.eclipse.platform_4.2.0.qualifier/css
  • Choose the CSS for the theme that you use
  • Replace swt-mru-visible: false; with swt-mru-visible: true;
  • Restart eclipse (I haven't tested if that's necessary, at all)

If that doesn't work, also look in INSTALL/configuration/org.eclipse.e4.ui.css.swt.theme/ for CSS files.

If you have a look at the css files of the different themes, you can see why switching the theme solves the problem as well.

=> http://wiki.eclipse.org/Eclipse4/CSS

3
  • Thanks, this made me crazy and I hadn't realized switching from XP to Win7 was the trigger for the issue appearing. BTW I'm running Eclipse 4.3.1 and it has more theme files in that dir than appear on the Theme drop down in the Appearance menu. I switched from Windows 7 to Windows 7 Classic. There's a file called e4_default_mru_on_win7.css but for some reason it doesn't seem to be available (apparently not mapped in plugin.xml). Feb 13, 2014 at 18:09
  • I couldn't find the css files to edit in my 4.4 installation (probably they are in a jar file) but E4 CSS Editor did it for me.
    – Erdem
    Oct 30, 2014 at 18:30
  • In Mars (4.5.2), I found the css files under plugins/org.eclipse.ui.themes_VERSION e.g., plugins/org.eclipse.ui.themes_1.1.1.v20151026-1355/css/e4_default_gtk.css
    – haridsv
    May 9, 2016 at 5:01
8

Here is a quick update for anweibel's answer for Eclipse Luna:

The CSS you wanna edit is now located at

  • INSTALL/plugins/org.eclipse.ui.themes_1.0.0.qualifier/css
0

Quick Linux fix for all themes:

cd <eclipse install dir>
find . -type f -name "*.css" | xargs grep 'swt-mru-visible: false'  | cut -d: -f1 | xargs -n1 sed -i.orig 's/swt-mru-visible: false/swt-mru-visible: true/'

This will find all CSS files with "swt-mru-visible: false", back them up with *.orig suffix and change to "swt-mru-visible: true"

You can find all backup files with"

find . -type f -name "*.orig"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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