Archive for the ‘Tips & Tricks’ Category

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?

Find Action Saves Time

Tuesday, June 9th, 2009

Instead of wasting your time searching the menus and toolbars in an attempt find out that action you need right now, use the Find Action command (Ctrl+Shift+A) to quickly locate what you need. It works just like Go to Class:

Find Action (Ctrl+Shift+A)

On-demand Tooltip for Values in Debugger

Wednesday, June 3rd, 2009

In Maia you can quickly look up a value in a debugger session by hovering your mouse over it (which is very handy for text values, for example):


When you need to browse through a large tree of values, this popup can be set to appear only after you invoke it.


The trick is that it is still viewable, but only when you hover mouse over a value holding the Alt key. Hitting Alt when the popup is open hides it — but that’s what you probably have already guessed.

There is also an option in the Settings dialog:

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.

Show Parameter Info in SQL

Monday, June 1st, 2009

In Maia the Show Parameter Info action (Ctrl+P) is available in SQL function calls and value expressions.

Using Scope-Based Code Highlighting

Sunday, May 10th, 2009

One of not so well-known features of IntelliJ IDEA is an ability to differently highlight certain scopes in code editor.

To use it, open the Settings dialog, under IDE Settings expand Editor, then expand Colors & Fonts, and select Scope Based preferences. You will see a list of predefined scopes, and the Edit Scopes button that lets you easily create your own.

Each scope is assigned a distinct color/font scheme — just like different language elements in Java, which makes it easy to distinguish from other code in the editor.

In the following example, it is used to quickly differentiate between real testing code and JUnit Classes (pattern: lib:org.junit..*):



Other use cases include highlighting of, for example, third-party framework code, distinguishing normal code from assertions, etc.

Generate Persistence Mappings by Database Schema

Monday, April 27th, 2009

The upcoming IntelliJ IDEA 8.1.1 includes a new option to generate separate XML mapping per entity.

Second Smart Completion for Array Elements

Sunday, April 19th, 2009

Do you use second smart completion feature? Did you know that it also can help you when you have an array and want an element of it? Just press Ctrl+Shift+Space two times when completing:

JBoss Seam jPDL Pageflow Graphical Designer

Thursday, April 9th, 2009

Most of IntelliJ IDEA advanced features (rename refactorings, navigation to source, usage search and the others) are available in JBoss Seam pageflow graphical designer.

Just right-click a node (page) or an edge (transition) to bring up a popup menu where you can select an appropriate action.

Moreover, you can double-click a page node to start in-place editing, create new pages using drag’n'drop and link existing pages together by simply drawing a line from one page to another.
 

Generating Bean Properties in Spring Contexts

Wednesday, April 8th, 2009

With IntelliJ IDEA you can easily generate multiple properties in your Spring application contexts. Just invoke Generate action by pressing Alt+Insert inside of a bean tag and select properties you want to generate.



IntelliJ IDEA analyzes property types and invokes an appropriate Live Template for each of the properties you selected.