Author Archive

“Go to Class by Name” tricks

Thursday, June 22nd, 2006

Two nice tricks for navigating to a class by name (Ctrl + N). Find out how to quickly find a class that ends with particular symbols.

Of course, these tricks can be used for other navigation features as well, for example when you navigate to a file (Ctrl + Shift + N) or symbol, i.e. method or variable (Ctrl + Alt + Shift + N).

Technorati tags: , ,

Something more about completion

Wednesday, June 21st, 2006

Along with basic code completion already described on this blog, IntelliJ IDEA provides so-called “smart completion” that can be considered as a separate feature. Sometimes users call it “super” or even “secret” completion. “Super” is because this feature is far more intelligent than simple completion. “Secret” comes from the fact that this completion is invoked not by the usual Ctrl + Space shortcut, but by Ctrl + Shift + Space.

Why have two different completions? Well, how often have you found yourself saying “This thing thinks that it’s smarter than me!” and try to make the product do what you want it to do? IntelliJ IDEA doesn’t want to be smarter than you are. But its intelligence is always at your disposal when you need it.

So, what is so special about smart completion? First of all, it filters the list of suggestions according to the expected expression type.

For example, it can suggest values at right-hand side of assignments, in the return statements, in method calls, and anywhere you need to.



In obvious cases where you don’t need to see a list of choices, smart completion will simply add the necessary value. For example, use Ctrl + Shift + Space after new when you create an instance of a class.



IntelliJ IDEA adds the constructor, brackets, and the semicolon. It also positions the caret right within the brackets. And all you need to do is press Ctrl + Shift + Space again to see the list of possible parameter values.



In case of abstract classes and interfaces, you can choose one of the inheritors.



Another example when you don’t need a list of choices is type casting. For example, you have typed something like str = (, where str is some variable of String type. To cast the right-hand side of assignment to String, just press Ctrl + Shift + Space. The result, of course, will be str = (String).

But, probably, the most impressive use case for the Smart completion is when you create an anonymous implementation of some interface. For example, you had the following code:



When you press Ctrl + Shift + Space and select the MouseListener interface, you get the following result:



Just think about the time the smart completion saves.

Note   This tip&trick was originally posted at www.javalobby.org.


Technorati tags: , ,

IntelliJ IDEA 5.1.2 Released!

Friday, June 16th, 2006

JetBrains is glad to announce the release of IntelliJ IDEA 5.1.2
This release fixes several stability issues and bugs. See the complete list for more detailed information.
Release is free for licensed users of IntelliJ IDEA 5.x and available for download at http://www.jetbrains.com/idea/download/

TabSwitch Plugin

Friday, June 9th, 2006

Of course, tabs is a good way for organizing opened files within an application. However, when you have too many opened tabs it becomes difficult to navigate between them. IntelliJ IDEA helps you to navigate between recently opened files (CTRL + E), but sometimes you need to switch only between the tabs.
The TabSwitch plugin allows you to switch between IntelliJ IDEA tabs like you switch between opened applications in Windows. With the plugin installed, just press Alt + A, and you’ll get the list of the opened tabs. The most recently used tabs come first.



As it turned out, Alt + A is not an intuitive shortcut. So, many developers changed it to Ctrl + Tab. This shortcut is used in IntelliJ IDEA for switching within splitted windows. But it is rarely used, so you can easily override it.
To change the shortcut, open Settings - > Keymap. Then select Plugins->TabSwitch, and configure its shortcuts (remember that you cannot modify the default keymap and need to create your own).



The plugin has more features and shortucts that help you with tab navigation. Here you can find the full description: http://www.intellij.org/twiki/bin/view/Main/TabSwitchPlugin

The TabSwitch is free and can be downloaded via IntelliJ IDEA Plugin Manager.

Technorati tags: , ,

Blog Tuning

Tuesday, June 6th, 2006

It’s now about three months since the IntelliJ IDEA blog was started. So, we decided to update it a little bit. We hope you’ll like the new color schema. But that’s not all. We also improved navigation (yes, now we have that “back-to-home” link on all the pages and the blog title is also a link to home).
Furthermore, now there is a registration. So, if you want to write your own IntelliJ IDEA tip or how-to, you are welcome. For writing posts we provided the standard WordPress interface. Of course, the posts will be moderated (nobody wants this blog to be filled up with spam).
Finally, we added “friendly” blogs to our blogroll. Everyone who is blogging about Java in general and IntelliJ IDEA in particular can send us a link to the personal blog using the “Share your knowledge” text box on the right side bar.
Welcome and enjoy the new look-and-feel! ;-)

The real power of code completion

Monday, June 5th, 2006

Code completion is now a must for each and every IDE. But are you using all its power in IntelliJ IDEA? Check out the tricks below to get the answer.

Complete variables names

How often do you need to declare something like ArrayList list? Using Ctrl + Space you can complete the name of the variable. In this example, you will be suggested to choose between arrayList and list names.



Use “CamelHump”

Probably, you already used “CamelHump” for navigation and search. But it works for code completion too. Everything you typed in the editor will be replaced with the relevant code.

CamelHump Completion

Replace expressions

For example, you have the following expression:

myFrame.setPreferredSize(new Dimension(800, 600));

And then you decided that this should be the minimum size. The fastest way to change this code in IntelliJ IDEA is to place the caret after the dot, then press Ctrl + Space. Find the setMinimumSize() method (don’t forget about “CamelHump”!), and press Tab.



The setPreferredSize() method will be replaced with the setMinimumSize(). Don’t worry about your parameters – they will stay where they are.



There are more tricks in IntelliJ IDEA related to completion (such as smart completion) that will be described in the future blog posts. But if you don’t want to wait, check out the Productivity Guide in IntelliJ IDEA or see description of java code assistance features.

Note   This tip&trick was originally posted at www.javalobby.org.


Technorati tags: , ,

Java SIG: Effective Java Reloaded and IntelliJ IDEA

Friday, June 2nd, 2006

The Monthly Meeting of the Java Special Interest Group (SIG) will take place on Tuesday, June 06 2006, 6:30 PM. Everyone who happens to be near Cubberly Community Center in Palo Alto, California is welcome.

The agenda includes two presentations (and pizza!). The first presentation - “Effective Java Reloaded” - will be made by Josh Bloch. And then, after a short break, Etienne Studer - an IntelliJ IDEA enthusiast and a valuable member of IntelliJ community - will make a presentation about IntelliJ IDEA.

Etienne Studer will demonstrate IntelliJ IDEA’s coding assistance, refactoring support, and plugin API. He’ll also highlight some features of the forthcoming IntelliJ IDEA 6.0.

Thanks in advance, Etienne, and break a leg!

Technorati tags: , , , ,

Automate your Ant scripts generation

Wednesday, May 31st, 2006

Making a product out of your project is usually a boring and time-consuming task: just think about all those build scripts, Java launchers, and installers. And it often takes more than a week to generate all these, then obfuscate your jars, and of course then comes maintenance.

The good news is that now you can easily generate Ant scripts that will make all these routine tasks for your IntelliJ IDEA project. The new product, BuildDesk, was released recently. Now all you need is to load your IntelliJ IDEA project, and BuildDesk will make a proper compilation and packaging, produce a multiplatform installer with a native launcher and obfuscated jars along with necessary Ant scripts - all in a less than an hour. Further maintenance is fun – what you used to fix for hours now will take minutes.

One more detail that may be interesting for IntelliJ IDEA fans is that all BuildDesk developers are former JetBrains employees that left the company to start their own business. So, you can expect to find the same level of usability and increased productivity in BuildDesk as you used to in IntelliJ IDEA. Just take a look at the BuildDesk demo.

And of course, BuildDesk will become an IntelliJ IDEA companion in the nearest future.

BuildDesk

Got intrested? Read more about BuildDesk, look at more screenshots, or download the trial right now.

Technorati tags: , , ,

IntelliJ IDEA 6.0: Built-in Struts Support

Tuesday, May 30th, 2006

Starting from release 6.0, IntelliJ IDEA will provide Struts support out-of-the-box. The functionality is added by Struts Assistant plugin that is now bundled to IntelliJ IDEA. So you’ll get it without any additional download and installation. Furthermore, the plugin will be better integrated with IntelliJ IDEA core and will immediately get all J2EE improvements and new features that will be available in the forthcoming IntelliJ IDEA 6.0. The plugin itself will be free and open source, so you can find it in IntelliJ IDEA plugin repository.

The next great news is that Dmitry Avdeev, the Struts Assistant plugin developer, is now hired by JetBrains. He’ll become a member of the J2EE team in IntelliJ IDEA. Welcome aboard, Dmitry!

Technorati tags: , , ,

JetBrains and Ajaxian joint survey

Monday, May 29th, 2006

After IntelliJ IDEA 5.1 release, JetBrains asked what do you need/want from AJAX tool. The discussion first started at Javalobby and then continued at Ajaxian. We thank everyone who participated, since the answers were really interesting and useful.
This time JetBrains starts a new survey together with Ajaxian to get more details about your AJAX needs. The survey contains 12 simple questions and it will not take a long time to answer them. In return, 10 randomly chosen participants will get free IntelliJ IDEA licences. The winners will be announced July, 1st, 2006.
Read more about the survery or go to survey right now.

Technorati tags: , , ,