This post is about an awesome Eclipse feature, that is completely underestimated and hidden in the menu. Yet, it is so useful in so many situations. The awesome “Block Selection Mode” which can be toggled through Alt-Shift-A on Windows. Here’s an example challenge for the Block Selection Mode:
When blogging about DSLs, I’m mostly blogging about internal domain-specific languages, because jOOQ is a good example for internal DSLs. But external domain-specific languages are an interesting topic as well. As an external DSL does not depend on any host language (e.g. Java), it can be much richer in syntax and expressivity. On the other hand, you need tools to parse, compile and maybe even interpret / run them.
Here’s a very interesting blog post showing how to create an external DSL with Xtext, Eclipse’s DSL tool chain. It creates a simple DSL to describe video game control flows and shows how Eclipse Xtext immediately provides an editor with all sorts of IDE features for that custom DSL:
I have recently discovered this new, must-have Eclipse plugin, which is very useful for those third-party libraries whose source-code you can’t easily find or link into your Eclipse: JDEclipse.
It doesn’t only decompile byte code into Java code, it does so extremely well, keeping line numbers at the correct place, such that you can actually debug through the decompiled source code and set breakpoints that actually work.
Disclaimer: Some users experienced this plugin to break their Eclipse Juno (see comments). Use at own risk!
Using keyboard shortcuts can vastly increase your productivity. Instead of switching between keyboard and mouse all the times, trying to figure out where that mouse cursor is, left/right clicking your way through context menus nested several levels deep, you could’ve just hit Alt–Shift-I, for instance, for inlining constants, variables, methods, etc… But how to remember the most important ones? Tricky…
This plugin will show a very annoying and obnoxious, big popup indicating the keyboard shortcut that you could’ve used just now instead of clicking through Eclipse menus with your mouse. For instance:
This will eventually annoy you so much that you’ll willingly use the suggested keyboard shortcut just to make the popup go away! And the best thing is, you’ll only learn the shortcuts for those actions that you really execute very often.
On fresh Eclipse installations, I usually feel a bit naked, until I realise that this lovely little plugin is not part of Eclipse itself. It’s called AnyEdit tools, and it features the following nice things:
Convert Tabs <-> Spaces
Convert: Chars <-> Html entities
Convert: Camel <-> Underscores
Convert: Invert Case
Convert: To Upper Case
Convert: To Lower Case
Convert: From/To Base64
Compare/Replace with Clipboard
Compare/Replace with Workspace File…
Compare/Replace with External File…
Compare/Replace with Opened Editor…
Most of these features are available through shortcuts, too. Download it, too and you’ll never want to miss it again!