Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Eclipse's Awesome Block Selection Mode

DZone's Guide to

Eclipse's Awesome Block Selection Mode

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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:

Is there any way I can write (copy-paste) nicely-formatted SQL queries in Java string literals using Eclipse?

And my answer:

Step 1: Paste

Paste your formatted SQL statement verbatim into your Java file

Step 2: Write opening quotes

Notice the highlighted button, the sixth from the left. That’s the awesome “Block Selection Mode” (Alt-Shift-A on Windows). It lets you write opening quotes on each selected line at the same position

Step 3: Write closing quotes and concatenation

Apply the same technique for the closing quotes and the concatenation sign (`+`)

Step 4: Fix the semi-colon

No comment needed here.

Awesome Eclipse feature, no?

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:
java ,eclipse ,ide ,tips and tricks ,feature

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}