Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the close button from editor tabs in Eclipse?

Tags:

editor

eclipse

I'd like to remove the close buttons from tabs in Eclipse 3.6.1. The close button is unnecessary (middle-click closes tabs) and annoying (makes it easy to close tabs by accident). Also, space is reserved for each close button to appear when a mouse-over event occurs so it makes the tabs wider than necessary.

Is there some tweak/hack that can disable this feature?

Thanks.

like image 656
Atorian Avatar asked Nov 17 '10 20:11

Atorian


3 Answers

I filed a feature request to add an option to remove the close buttons from the tabs: https://bugs.eclipse.org/bugs/show_bug.cgi?id=362176

Please comment on that RFE. Thanks.

like image 110
dotancohen Avatar answered Nov 06 '22 06:11

dotancohen


Removing the Close button is possible via CSS:

As example, see: enter image description here

More details:

To remove the close button, first check your Preferences > General, to ensure the Styling is enabled.

1) Locate your current css. In my case the path is:

eclipse\plugins\org.eclipse.ui.themes_1.2.0.v20160718-0743\css\e4_classic_win7.css

2) Add the CSS code to disable the close button

CTabItem {
    swt-show-close: false !important;   
}
like image 39
psuzzi Avatar answered Nov 06 '22 05:11

psuzzi


I don't think there's a setting for this in Eclipse but you could (if you wanted it bad enough :P) take the Eclipse source code, edit them out and compile your own version.

like image 1
Richard Marskell - Drackir Avatar answered Nov 06 '22 06:11

Richard Marskell - Drackir