Saturday, June 13, 2009

Every pixel counts! The new eclipse fullscreen plugin...

A few days ago Kevin McGuire blogged with the title Every pixel is sacred (not any more!) and a follow up Eclipse UI Real Estate Wasters!. I still believe that every pixel counts and I often wanted to have eclipse in full screen mode to save a few pixel. I use full screen mode in the browser and with pdf files a lot and I really love it. I remembered that there is a new Shell.setFullScreen method in SWT. During a boring meeting, I decided to create a small plugin that would add a toolbar button and a menu entry to toggle eclipse in to fullscreen. I started with the "New Plugin wizard" and choose the Hello, World Command example and replace the handleCommand line with one line:
window.getShell().setFullScreen(!window.getShell().getFullScreen());

I changed the labels in the plugin.xml and I was done, in less than 10 munites.....

I should know that even "simple" things can be quite complicated.
I wanted to make the plugin nice and share it but that was the start of a nightmare..... but that is another story.


Download/update


You can use this site as update site or download the plugin from here: gr.scharf.fullscreen.zip


Functionality


The plugin has been written for eclipse 3.5 but it works also for eclipse 3.4 although there are some problems with the handling of the toggle state of the commands...

The plugin adds a Fullscreen command to the Windows menu and a Keybinding M3+F11 which translates on windows to Alt+F11:



When fullscreen mode is active all (main) windows are in full screen mode:



There is also a Toolbar button that can be enabled. Because the plugin uses the Commands Framework there are some unfortunate restrictions (bug 280033):

  • When you go to Window->Customize Perspective->Tool Bar Visibility, you will not find the Fullscreen tool bar unless you have enabled it in Window->Customize Perspective->Command Groups Availability

  • The Toolbar details are empty, although the toolbar contains a command:



Once you have succeeded enabling the toolbar button, it will look like this:

and

I decided to hide the button by default, because in most cases the shortcut and the windows menu command should be enough.