Archive for October, 2009

Bean Validation Support Becomes more Powerful in Maia

Monday, October 5th, 2009

In earlier post about Bean Validation support, we focused on Java related things. In other words, we only talked about Bean Validation support in Java code. IntelliJ IDEA 9 (Maia) also has powerful Bean Validation support in XML descriptors (validation.xml and XMLs describing constraint mappings).

Let’s start from filling out validation.xml. All features like classes/packages completion are working as we’re expecting them to:

And, of course, all standard inspections like wrong class, package or file path also work here. (more…)

Intelligent Copy&Paste

Friday, October 2nd, 2009

Do you find yourself copying and pasting parts of bodies between different methods and then facing broken code?

Unfortunately, parameter names tend to differ — like in this (very simplified) example:

Nothing is easier than fixing this problem with a few keystrokes in IntelliJ IDEA!

First, move caret on any red reference (highlighted with red color), or simply press F2, and then invoke available Quick-Fixes via Alt+Enter:

Now select Rename Reference (again, you can use arrow keys or just start typing Ren.. + Enter) and… IntelliJ IDEA fixes code for you!

See, sometimes it’s just the small features making it possible to achieve maximum productivity.

Quick Lists to Group Your Favorite Actions

Thursday, October 1st, 2009

There’s a lot of useful actions in IntelliJ IDEA that don’t have shortcuts for many different reasons: they’re not used too often or there’s simply no more convenient key combinations left.

For example, I often want to get access to VCS actions like Compare with latest repository version or Revert current file or even submit a single file with a quick NPE fix without opening a menu or going to Changes view.

So how can I call any of these actions with a single shortcut? That’s really easy: I just need to define my own Quick List and map it to a shortcut (Control-X in my case). After I’ve done that, every time I press Control-X I will get a pop-up like this:

Quick List in action

Quick List in action

Now I can press 5 to quickly commit the current file or 2 to revert all my changes. OK, now let’s see how to create a Quick List and assign it a shortcut.

(more…)