Small static import finder tool (for LWJGL)

Introduction
I bet anybody working with LWJGL has run into this problem… you need, say, these:
[list]

  • [icode]glDrawElementsInstanced(…)[/icode]
  • [icode]glGetUniformLocation(…)[/icode]
  • [icode]GL_FRAMEBUFFER[/icode]

but where on earth are they defined? Google usually answered my question, but it was such a hassle!

Static-Import-Tool to the rescue!

Features

  • Intelligent query engine: can match partial camel-case patterns (see screenshot)
  • Results are ordered so that most likely method is listed first
  • Generates the static-import line, selects it when clicked for easy copying.
  • Nothing else, it’s a small tool!

Screenshots

Download

Usage:
[/list]


java -jar static-import-tool.jar /path/to/lwjgl.jar
// or just Run in Eclipse, and it will search for lwjgl.jar in the classpath

Added support for static fields!

The matching algorithm is a tad better than Eclipse’s (fwiw), as Eclipse cannot auto-complete on partially provided static fields (“GL_CO_B_” -> “GL_COLOR_BUFFER_BIT”)

I get an error, when trying to run it.

Thanks for testing!

Usage:


@@java -jar static-import-tool.jar /path/to/lwjgl.jar
// or just Run in Eclipse, and it will search for lwjgl.jar in the classpath

:-*

Arh, neat. Now I just get a handful of warnings, but the app runs without problems. :slight_smile:

@Regenuluz: those warnings are the result of Class.forName(anyClassNameInJar) failing - which is harmless.

I just added support for UP / DOWN key events in the query textfield, so you can select the best match, without using the mouse.

This is quite an intresting tool.

If you want to have static-import autocompletion, then you can edit your “Favourites” preferences in eclipse. Go to Window -> Preferences then go to what this image shows:

Personally I find this a much faster and cleaner way, but since this only works in eclipse this is not useful to IntelliJ and NetBeans users :slight_smile:

It’s just not all that necessary for IntelliJ. Just start typing a static member name for something that’s in your project’s scope and hit ctrl-space twice (or ctrl-alt-space once).

I was hoping Eclipse had something like this – thanks!

Neat tool! FWIW, Eclipse syntax for a search (eg, in the Open Resource dialog) Some*ing. Doesn’t work for autocomplete of course.

You’re welcome :slight_smile: