Following a discussion with a friend over keyboard support in Eclipse’s Run/Debug UI, I decided to put my recently acquired Eclipse plug-in development skills to use. His gripe was the lack of keyboard-driven access to the history of things you’d run (especially as the drop-down buttons on the toolbar made it obvious that Eclipse was tracking this somewhere). A week or two of coding after work and Eclipse Run Helper was ready to fill the gap.
Installing it is simple: just grab the plug-in, throw it in the “dropins” folder of your Eclipse instance (tested on 3.7 upwards), and you’re done. To use it just hit Ctrl+Shift+F11 for Run, or Shift+F11 for Debug, then one of:
- A number from 1 to 5 to select an item from your history
- The letter “t” to re-run your last (JUnit) test run
As far as development, it wasn’t too bad. The biggest roadblock I ran into was the inability to display anything other than the Command name in the UI you get for “two stage” keyboard shortcuts (not sure if there’s an official name for those, but think
Alt+Shift+d and similar). This meant that if I went the easy route and just defined a bunch of commands (one per shortcut) in
plugin.xml, I was stuck with an unintuitive UI which didn’t show the name of the project being run, only something nasty like “Run 3rd last project”.
I ended up implementing my own UI to look as similar to those keyboard shortcuts as possible, but which gave me the flexibility to change what was displayed. A pleasant side effect was that it was easy to display the correct icon for each type of run configuration next to the name. In an ideal world, I’ll be able to remove this some day, but I won’t compromise the UI to do so.
If you’d like to contribute, or are just interested in having a dig around the source, it’s available on Github (under the Apache 2.0 licence). I’d appreciate any ideas/feedback that you have too, and have noted a few of my own ideas at the end of the README file. At some point I want to get this functionality into the Eclipse Platform itself, though figuring out that process will be a totally new experience for me.