Author Archive

Packaging JavaFX 2 Applications in IntelliJ IDEA 12.1

Monday, March 25th, 2013

This is the third part of the JavaFX 2 serie about the new features coming in IntelliJ IDEA 12.1. Today we would like to show how you can prepare your application deployment bundles.

Since the last two posts we have updated the project wizard so when you create a project it comes with an already configured artifact.

If you accept to create a project and open File → Project Structure → Artifacts, you will see a configured artifact of JavaFx Application type.

(more…)

Support for JavaFX 2 CSS in IntelliJ IDEA 12.1

Friday, March 15th, 2013

This is the second part of the serie about Java FX 2 support in the upcoming IntelliJ IDEA 12.1. Today we would show some features dedicated to help you to skin your JavaFX application with CSS. We would use the same sample application we were using in the previous post.

As you know JavaFX allows to configure stylesheets for nodes in your .fxml. IntelliJ IDEA helps to complete existing .css files:

You may rename, move, etc your .css file, the reference would be updated accordingly. If you deside to add one more stylesheet and want to convert attribute value to subtag, the IDE would also help you here.

(more…)

Support for JavaFX 2 in IntelliJ IDEA 12.1

Tuesday, February 26th, 2013

Over the last year we have been asked to add support for JavaFX 2 quite frequently. Today we are pleased to announce the first preview of the JavaFX 2 plugin for IntelliJ IDEA 12.1.

Having Java 7 installed you may create a new demo project based on JavaFX Application template:

(more…)

Java 8 and Method References in IntelliJ IDEA 12

Monday, October 22nd, 2012

As you might know IntelliJ IDEA 12 will bring support for new features of Java 8 language. Though this is still in progress, you can try some of these features now in IntelliJ IDEA 12 EAP.

Here we would like to provide some details on method and constructor refereces support.

IntelliJ IDEA as always provides a way to transform existing code to use new features. Dedicated inspection finds and highlights anonymous types which can be replaced with a method reference.

After you apply provided quick-fix, it gets just a line of code.

There is also another inspection that checks if a lambda expression in your code can be replaced with a method reference.

You can also use an intention  to replace a method reference with a lambda expression, in the case when you need additional logic.

All the common features such as completion, refactorings, formatting and many other were updated to support method and constructor references.

As always you are very welcome with suggestions and feedback in our issue tracker.

Develop with Pleasure!

New Coverage View in IntelliJ IDEA 11.1

Friday, March 30th, 2012

IntelliJ IDEA 11.1 introduces a new way of browsing the gathered coverage information through a dedicated Coverage View.

This view aggregates the coverage details over a configured scope in one place. It provides ability to sort data by coverage percentage, what can be used for detection of code which is not enough covered by tests.

As always quick navigation, scroll from/to source, flatten packages mode are available in Coverage View for an easy work with the results. It also allows generating HTML report right from the view.

Please note, that the view is also available for Python, Ruby and PHP coverage plugins.

The new feature is already available in IntelliJ IDEA 11.1 released a few days ago. We appreciate any feedback. Please don’t hesitate to submit any found issues to our tracker.

Testing Tip: Run Test Method from Abstract Test Class

Monday, February 13th, 2012

Sometimes you have an abstract test class with test methods where the inheritors set up different environment. As it is impossible to run an abstract class you had to enumerate inheritors manually, choose corresponding methods and run these methods one by one.

Now (since IntelliJ IDEA 11.1) it is possible to run tests right from the abstract base class and simply choose inheritors from the popup.

This works for JUnit and for TestNG tests.

Do you know where ‘Go To…’ can get you?

Thursday, January 19th, 2012

How often do you use ‘Go To Class/File/Symbol’ feature in IntelliJ IDEA? Pretty often I would guess. But do you know everything you can do with it? Let me go through a couple of often overlooked gems.

Do you know that when you search for file or class you can preview an image (Ctrl-Shift-I) or see a quick doc (Ctrl-Q)?

It is also possible to open multiple items in the editor (multiselect with Ctrl or Shift) or run multiple selected tests right from the search (Ctrl-Shift-F10).

And you can open all search results in the ‘Find’ tool-window to process them one by one later.

Did I mention your favorite feature? No? Please, share it with everyone! :)

IntelliJ IDEA does not show some files? Know the hiding-places

Thursday, April 28th, 2011

Have you ever found yourself in a situation when there is a file that exists on the disc but IntelliJ IDEA doesn’t show it anywhere? You press synchronize but nothing happens? OK, may be the next few tips will be helpful.

  • Check “Ignored files and folders” in File | Settings | File Types:
  • Check “Excluded roots” in File | Project Structure

Your files are shown in Project View but they are missed at runtime?

  • Check compilation patterns in File | Settings | Compiler
  • Check that they were not excluded from compilation in File | Settings | Compiler | Excludes

We hope that these simple tricks will save your time as well as ours. :)

Fork your tests with IntelliJ IDEA 10.5 EAP build 106.447

Tuesday, April 12th, 2011

One of the latest features was long awaited fork mode for JUnit run configurations. Since now it is possible to run your tests in separate VMs. It is possible to choose to fork on class level only.

Check out the list of all changes in the release notes on the IntelliJ IDEA EAP page and download the new build.
Btw, we are going to freeze IDEA 10.5 development soon, so we are actively looking forward for your feedback!

Java 7. @SafeVarargs

Friday, April 8th, 2011

Java 7 provides a way to remove a compiler warning about generics vararg invocation. With Java 7 you can annotate your vararg method with SafeVararg annotation and your clients won’t get these nasty warnings any more. IntelliJ IDEA 10.5 will help you to perform this migration. It will find for you all the places where @SafeVarargs annotation is applicable and suggest you to add this annotation. Of course, it will also check if existing @SafeVarargs annotations are applicable.

Suppose you have annotated your method with @SafeVararg but already have suppressions for unchecked warning in client’s code:

Since its version 6 IntelliJ IDEA contains an inspection to find redundant suppressions (available in batch mode only). Now you can use it to remove all suppressions which are garbage in your code. It will carefully check that these unchecked warnings were caused by generics vararg invocation and suggest you to remove all such suppressions. Simply run the ‘Redundant Suppression’ inspection (Ctrl-Alt-Shift-I).

All you need to do is to install Java 7 and setup language level to 7.

Download IntelliJ IDEA 10.5 EAP, try the new described features and let us know what you think.