Eclipse RCP
20.09.2010 - 24.09.2010, Hamburg
git
07.10.2010 - 08.10.2010, Essen
15.04.2009

Using static methods with content assist

Frameworks like JUnit and Hamcrest are offering APIs that are to be used with Java static imports so you can write “DSL-like” code:

assertThat(Math.sqrt(-1), is(notANumber()));

You can add classes offering such static methods in Preferences > Java > Editor > Content Assist > Favorites:

Using static methods with content assist

These methods will be proposed in content assist automatically:

Using static methods with content assist

I'm looking forward to your comments:

Schulungen

Eclipse IDE Tips and Tricks

Ralf Ebert | Blog | Eclipse IDE Tips and Tricks | Using static methods with content assist