How to remove the close (×) button from Eclipse Juno tabs?

5

4

Is it possible to remove the close button from main editor tabs? I've heard there is a new UI model in Eclipse Juno (e4) that uses CSS for tuning, so is it possible to write some CSS to remove close button from the tabs?

I didn't found anything useful regarding available css rules and selector for the new UI.

Sergey Stolyarov

Posted 2012-07-04T08:40:50.730

Reputation: 201

Answers

5

Just found a solution:

  1. First you need to install E4 tools (from update site http://download.eclipse.org/e4/updates/0.12/): Er CSS Editor (Incubation) and restart Eclipse
  2. Now go to Preferences (menu WindowPreferences, then Appearance), there you should find CSS editor for Eclipse UI
  3. Add the following piece of code at the end of CSS code:

    CTabItem {
        swt-show-close: false !important;   
    }
    
  4. Restart eclipse.

Sergey Stolyarov

Posted 2012-07-04T08:40:50.730

Reputation: 201

2

In addition to Sergey,

You don't have to install any plugin to actually edit the CSS file. If you goto

(eclipse-folder)/plugins/org.eclipse.platform_4.2.***/css/e4_default_gtk.css

and edit this file you will get the same result.

CTabItem {
    swt-show-close: false !important;   
}

Dkyc

Posted 2012-07-04T08:40:50.730

Reputation: 41

Just an update for Version: 2018-12 (4.10.0) - The path is a bit different; eclipse/plugins/org.eclipse.ui.themes_1.2.300.v20181108-1102/css/e4_default_gtk.css and css/dark/e4-dark_globalstyle.css for the dark theme. – Alan G. – 2019-02-27T19:54:17.377