Author Archive

UML-like Diff Tool

Friday, February 12th, 2010

If you’re a lucky owner of IntelliJ IDEA 9 Ultimate Edition, you’ll be surprised to find a new action in VCS History panel: view all changes made in commit in a single dialog. This feature makes it simpler to understand what a commit author made in his change.

To start using this feature, invoke Show History action for any file, then select revision you’d like to investigate, and then click UML icon (or press Control+Shift+D).

This opens the following diff dialog:

As you can see, 3 changes are made in layout.properties, Rounded interface and RoundedButton class. By default, green color marks what was added, blue is for changed, and gray, guess what — deleted. Well, what else can we see here? RoundedButton class doesn’t extend JComponent and does not implement ButtonModel interface anymore, but instead it extends AbstractButton class and implements MouseListener and KeyListener interfaces. Also, author has changed method paint and removed method isPressed. Interface Rounded was added from scratch and some properties were modified, added and removed in layout.properties file. Double click on a node shows standard diff dialog.

You will be able to enjoy this UML-like Diff Tool in next EAPs and also in the nearest IntelliJ IDEA 9 update.

IntelliJ IDEA PSI Viewer

Thursday, November 19th, 2009

If you’re an IntelliJ IDEA plugin developer, you’re surely going to enjoy IntelliJ IDEA PSI Viewer (Tools -> View PSI Structure), which displays internal structure of various files, as they’re interpreted by IntelliJ IDEA. If you’re implementing a new language support, or trying to add some cool new features to what’s already supported — this viewer is what you’re gonna need a lot.

As you see, PSI Viewer is made up of of tree parts:

  • An editor with file content
  • PSI structure view with parent-child tree of its elements
  • Area that displays references of element selected in PSI structure view.

Note that references marked as red resolve to null.

Available since build 92.35

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…)

5 Cool Shortcuts You Have Probably Never Tried

Thursday, July 30th, 2009

I’d like to tell you a bit about a bunch of cool IntelliJ IDEA shortcuts you have probably never heard of.

Ctrl+W/Ctrl+Shift+W When it comes to precisely selecting a value, expression, statement or any other block of code, these shortcuts are a real killer. Just try it to see how quicker it works than traditional Ctrl+Shift+NavKeys combo.

Ctrl+Shift+F12 This hides everything but the editor and so leaves you tête à tête with the code.

Ctrl+Tab, Delete Pressing Delete when Switcher is open (Ctrl+Tab) allows you to close arbitrary editor tabs and hide tool windows (available in Maia builds 10612 and later).

Ctrl+Alt+Shift+Up/Down If you are using Version Control integration, you gonna love this because so you can quickly navigate between changes in a file.

Alt+Home Summons Navigation Bar to an active window, so you can now hide it from under main menu and quickly use whenever needed. By the way, all the cool shortcuts (Alt+Insert, for example) work nice inside of Navigation Bar, which lets you create new files, classes, and everything really really quickly.


Hope this all makes development even more a pleasure!

Ctrl+Tab Switcher in Maia

Wednesday, July 8th, 2009

Maia brings a new powerful action Ctrl+Tab that allows you to switch between open files in editor and tool windows. It works similar to Alt+Tab on Windows or ⌘+Tab on Mac.



There are two columns: tool windows and open files (tabs). Navigation is available through the use of navigation keys and Tab (forward) or Shift+Tab (backward) keys.

Is there anything else you think would be handy to have in Switcher Panel?

Icons Preview in Gutter Bar

Friday, June 26th, 2009

Maia supports preview of icons you are using in Java code directly from the editor. For each of the icon definitions (javax.swing.Icon), Maia tries to locate a file from which it is loaded and then shows a preview in the gutter bar. You can click it to open the image for editing, of course.

Flip Setter Call Intention Action in Maia

Tuesday, June 2nd, 2009

Two-way synchronization between different data models is a common routine task and often developers are stuck with manual copying of data from one model to another for many reasons: model complexity, impossibility to create a simple binding, etc. For example, we have a settings model and an UI to configure it. Traditional approach suggests implementing two methods:

  • Initializing UI from settings
  • Persisting changes from UI to settings


Next, we need to implement a method (say, saveSettings), similar to initUI where UI changes are persisted to the ProxySetting object — quite boring, isn’t it?

How to do it quicker than just writing from scratch? In Maia we’ll do it twice as easy: copy the body of initUI method to saveSettings, select the just pasted code and press Alt+Enter.
Then, select Flip Setter Call intention action and enjoy.

Bean Validation support in IntelliJ IDEA 9

Wednesday, May 20th, 2009

Initial Bean Validation support will be available in IntelliJ IDEA 9 (Maia). The first Maia EAP will include the following features:

  • Dedicated facet for Bean Validation. This will help you use different Reference Implementations (RI) of Bean Validation. By now, there is only one RI available in the Bean Validation facet, namely the Hibernate Validator 4.0.0.Beta1:
  • Bean Validation tool window with all module Constraints and Constraint Validators:
  • Several inspections of Constraint annotations with quick fixes for them; RegExp language injection into @Pattern annotation:
  • Helpful quick fix for Constraint Validators generation:

Viewing Change Details on UML Class Diagram

Tuesday, April 28th, 2009

When you have changes in several files or classes and want to see what they affect, you typically use the Changes tab and then Show Diff action for every affected file or class. In Maia, you will be able to see the complete picture at once, via UML Class Diagram. It is improved to allow viewing and highlighting of changed and removed classes, methods, fields and so on when you press Ctrl+Alt+Shift+D.

Code Foldings for I18n Support

Thursday, March 26th, 2009

As you may know, IntelliJ IDEA 8 includes the complete i18nization support. In IntelliJ IDEA 9 (Maia) it will be improved with special i18n foldings that would allow to hide method calls, retrieving properties from resource bundles and replace them with actual property values.


If properties contain any parameters, they will be automatically evaluated before displaying.