Archive for July, 2006

IntelliJ IDEA 6.0 & TeamCity 1.0 Beta Release

Friday, July 28th, 2006

JetBrains is pleased to announce the wide public beta release of IntelliJ IDEA 6.0 and TeamCity 1.0.

We’d like to encourage you to download both beta versions, try them out, and let us know what you think.


Technorati tags: ,, , , ,

Surround With…

Tuesday, July 25th, 2006

IntelliJ IDEA makes it very easy to surround a code block with if, while, for and other statements or to make a code block become part of such statments as try/catch or synchronized. Simply select the code block to surround (don’t forget to use Ctrl + W to increase the current selection) and then press Ctrl + Alt + T (or right-click the selection and select Surround with… from the menu). IntelliJ IDEA will show a list of options to choose from.



Once you have made your choice, IntelliJ IDEA will add the necessary code and put the caret to the position that allows you to complete the surrounding statement, if needed.



After that, you’re done. As you can see, adding such a surrounding if statement does not break the flow of coding at all and there is no need in any additional key stroke or mouse move.



Furthemore, IntelliJ IDEA not simply surrounds the code, but makes it as smart as possible. For example, if you choose to surround a code block with a try/catch statement, IntelliJ IDEA will add all necessary catch statements for all thrown exception types that it is able to determine within the selected code block.

Another useful scenario of using ‘Surround With…’ is when inspecting objects in the debugger’s Expression Evaluation window. Let’s say you want to evaluate a method call on the inspected object where the method is a part of the runtime type but not a part of the declared super type. IntelliJ IDEA helps you with casting the object to the runtime type: just press Ctrl + Alt + T in the expression box, and select Surround With ((RuntimeType) expr) from the list.



You can then invoke any method that is a part of the runtime type of the inspected object. Again, the described operation of casting to the runtime type does not break the flow of coding due to IntelliJ IDEA’s intelligent and unobtrusive assistance.

By the way, the Expression Evaluation view supports code completion, JavaDoc popup, etc. just like the normal Java editor.


Technorati tags: , ,

Smoothen HTML and XML editing in IntelliJ IDEA

Thursday, July 20th, 2006

When you open a tag, IntelliJ IDEA assists you by automatically inserting the closing tag. This is really handy and helps avoid certain errors, but when you are typing a text and, say, want to highlight a couple of words with bold, the </b> tag which is inserted just after <b> makes you press the right arrow several times to skip it so that you can continue typing.

To smoothen the editing, use CTRL+[ and CTRL+] keyboard shortcuts that let you navigate to the first character of an opening tag or to the last character of a closing tag.

IDEA Quick Tag Jump

In this particular case, when you are done typing text inside the <b></b>, press CTRL+] and then right arrow to get outside the tag. No matter how long it is (<em>, <font>, <strong>) you can leave it just in two key strokes and go on typing your code.

These shortcuts are also really handy for quick jumping through lengthy tags without folding them.

Technorati tags: , , ,

Designing GUI with pleasure: live demo

Monday, July 17th, 2006

The live demo showing the enhanced GUI Designer (one of the announced features of the IntelliJ IDEA 6.0 release) is published at Javalobby. The presentation is made by Dmitry Jemerov, JetBrains developer who actually made all the new GUI designer features. Learn how to design Swing UI with pleasure!

Technorati tags: , , , ,

What’s new in IntelliJ IDEA 6.0 and what’s TeamCity?

Thursday, July 13th, 2006

The full list of features for IntelliJ IDEA 6.0 release is now available. Learn more about improved Java EE development, enhanced Swing GUI designer, team work facilitation, and other new features and improvemnts at www.jetbrains.com/idea/features/newfeatures.html.

The overview of the new JetBrains product - TeamCity - is also published. TeamCity is an official name for the “Team Server” that is an integrated team environment which, following the tradition of IntelliJ IDEA, brings the software team productivity to a whole new level. You can learn more about TeamCity at www.jetbrains.com/teamcity/.

And the final news is that JetBrains launched the “Buy IntelliJ IDEA 5.1 now and get Version 6.0 and TeamCity 1.0 for free” offer. Don’t miss the chance - buy IntelliJ IDEA 5.1 or upgrade to it from your current version right now.

Technorati tags: ,, , , ,

Spring Bean Support

Monday, July 10th, 2006

IntelliJ IDEA is aware of the Spring beans that are part of your project. If you apply Find Usages on a property setter method, for example Customer#setLastName(), and there is a Spring bean of the matching type and with the matching property being declared in a Spring XML file, IntelliJ IDEA will find it and will properly list it as a usage.



IntelliJ IDEA also respects Spring bean definitions during Safe Delete actions. On a side note, it does not make a difference whether Find Usages, Safe Delete, Rename Method, etc. are applied on the property setter method in the Java code or on the property attribute value in the Spring XML file.

You can also apply Goto Declaration (Ctrl-B or middle-button mouse click) on the name attribute’s value in the Spring XML file, for example on lastname, and IntelliJ IDEA will take you to the property setter method in the Java code.

Technorati tags: , , ,

Customizing TODO filters

Friday, July 7th, 2006

Note   Contributed by: Esko Luontola

Probably, you already know about IntelliJ IDEA TODO window that finds your “TODO” comments and helps you quickly navigate to them. But did you know that you can work not only with TODO comments, but with any custom pattern?

For example, when you create a quick fix for a problem and don’t have the time to create a proper solution, you write a “hack” and leave a comment. You can start the comment from “Hack” and then explain why this code is bad and what should be done to fix it. Of course, it would be useful to find these comments later and navigate to them like you can do with TODO.

To add a new comments pattern, you need to press “Filter TODO Items” icon in the TODO tool window, and then select Edit Filters.



This will open the TODO dialog, where you can add, delete and modify your patterns. You can also apply filters that will display only certain patterns in the TODO window (to switch between filters, use the same “Filter TODO Items” icon).



When you add a new pattern, you can also specify the text color (it will appear in both the editor and TODO tool window) and the icon that can be used to show the priority.



After that, you can find your “hack” comments in the TODO window.



Technorati tags: , ,

IntelliJ IDEA 6.0: Code Coverage

Tuesday, July 4th, 2006

In forthcoming IntelliJ IDEA 6.0 release a new tool will be available. It aims to measure the code coverage for your unit tests or tests written as simple applications with the main() method. The engine that performs code coverage in IntelliJ IDEA is based on the EMMA open-source toolkit.

The feature as implemented by IntelliJ IDEA brings several technical innovations to the Java code coverage field.
The most important of them are:

  1. On-the-fly code coverage execution with no classes pre scanning phase
    IntelliJ IDEA has no need in static classes instrumentation making use of instrumentation concept introduced in Java 5.0. Moreover, IntelliJ IDEA already knows the structure of your project, so it can calculate the package coverage statistics based not only on those classes that have been instrumented, but taking into account all compiled classes for the package. Essentially this brings lazy coverage calculation concept into action and ensures low run time overhead.
  2. Correct coverage information displayed for files edited after coverage statistics has been gathered
    How is it possible? Well, again this is a result of a tight integration of coverage support with the rest of IntelliJ IDEA infrastructure. Here the result is obtained by collecting the information on the difference between the current file version and the one created at the moment coverage was run (taken from the local VCS).



To get the feeling of the code coverage, you just need to configure this feature and run your tests or applications. You can access this feature by selecting Run | Edit Configurations (or by pressing Shift + Alt + F10). The Run/Debug Configurations dialog appears where you can enable and configure the feature.



To run the coverage measuring, simply run or debug the configuration.
Whereupon, the statistics on the lines covered can be displayed in the Project View by selecting View-> Show Coverage Information or pressing Ctrl+Alt+F6 in the default keymap.



Also right in the editor you’ll see whether the lines were covered or not (they are marked green and red, respectively). The yellow mark indicates that the line was executed “partially”, for example, if only one condition from the if statement was checked.



The feature is already available in the latest EAP version. Join EAP now!

Technorati tags: , , , ,

JetBrains-Ajaxian Survey Winners Announced

Monday, July 3rd, 2006

The JetBrains-Ajaxian Joint 2006 Survey is now officially closed. We'd like to thank the over 600 developers who participated in the survey. The results will make a difference in the way JetBrains will approach AJAX support.

As a little carrot to encourage participation, we gave away 10 free personal licenses for IntelliJ IDEA 5.1 to randomly selected survey participants. The winners list appears on our website at http://www.jetbrains.com/idea/quest_intro.html.

Thanks again to all who participated in the survey, and stay tuned for cool new AJAX features in IntelliJ IDEA!