I for one welcome our new e4 overlords

As an Eclipse user, I have to say that having all those views in various stacks can really start taking away from the amount of space dedicated to just editing a file. Even at full screen, there’s portions of the UI that I could do without. For example, the status bar that sits at the bottom of the workbench takes up quite a bit of space for something that is rarely used. It has a progress bar built in, but I can always just refer to the progress view. The only real loss would appear to be the status line indicator for various things such as file privileges, line number/offset. Even these things don’t deserve a horizontal bar all to themselves.  Luckily this is a blog post, so naturally there’s something in the form of a solution coming up.

eclipse-with-toolbar-statusbar

Someone introduced me to the Eclipse 4 CSS Spy . There’s also a quick tutorial of it in action here . With this plugin, we can get a nice visualization of the e4 model hierarchy, along with an indication of where each model element is located in the workbench window (<ALT> + <SHIFT> + <F5> to activate ). I have to say, it’s rather shameful that I haven’t used this sooner, especially since it was probably mentioned at one of the DemoCamps I hosted in the past.

eclipse-css-spy

Just by clicking around the e4 model, we can easily see that we need to disable the MTrimbar with id ‘org-eclipse-ui-trim-status’ by setting its ‘visibility’ property to some attribute that would disable it. Looking around the Eclipse platform code base, under  eclipse.platform.ui/bundles, we find that the property we want is ‘hidden’. (See AbstractCSSPropertyClassificationHandler for the reference to ‘visibility’ and applyCSSPropertyVisibility in CSSPropertyClassificationSWTHandler for the implementation mentioning ‘hidden’)

With that discovered, we can finally write our selector. We just add the following to the theme file we’re using. Since I’m running Fedora Eclipse, this is in :

/usr/lib64/eclipse/plugins/org.eclipse.platform_4.2.2.v20130320-1959/css/e4_default_gtk.css

and we’ll add the following line :

#org-eclipse-ui-trim-status { visibility: hidden; }

If you use keyboard shortcuts for most things, you can probably get rid of the main toolbar as well.

#org-eclipse-ui-main-toolbar { visibility: hidden; }

eclipse-no-toolbar-statusbar

Being able to customize the Eclipse workbench to this extent, so easily is really awesome.

Advertisements